1/*-------------------------------------------------------------------------
4 * definition of the "index" system catalog (pg_index)
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/catalog/pg_index.h
13 * The Catalog.pm module reads this file and derives schema
16 *-------------------------------------------------------------------------
22#include "catalog/pg_index_d.h" /* IWYU pragma: export */
25 * pg_index definition. cpp turns this into
26 * typedef struct FormData_pg_index.
34 int16 indnatts;
/* total number of columns in index */
35 int16 indnkeyatts;
/* number of key columns in index */
36 bool indisunique;
/* is this a unique index? */
37 bool indnullsnotdistinct;
/* null treatment in unique index */
38 bool indisprimary;
/* is this index for primary key? */
39 bool indisexclusion;
/* is this index for exclusion constraint? */
40 bool indimmediate;
/* is uniqueness enforced immediately? */
41 bool indisclustered;
/* is this the index last clustered by? */
42 bool indisvalid;
/* is this index valid for use by queries? */
43 bool indcheckxmin;
/* must we wait for xmin to be old? */
44 bool indisready;
/* is this index ready for inserts? */
45 bool indislive;
/* is this index alive at all? */
46 bool indisreplident;
/* is this index the identity for replication? */
48 /* variable-length fields start here, but we allow direct access to indkey */
56 * (AM-specific meanings) */
57 pg_node_tree indexprs;
/* expression trees for index attributes that
58 * are not simple column references; one for
59 * each zero entry in indkey[] */
60 pg_node_tree indpred;
/* expression tree for predicate, if a partial
66 * Form_pg_index corresponds to a pointer to a tuple with
67 * the format of pg_index relation.
74 DECLARE_INDEX(pg_index_indrelid_index, 2678, IndexIndrelidIndexId, pg_index, btree(indrelid oid_ops));
79/* indkey can contain zero (InvalidAttrNumber) to represent expressions */
82#ifdef EXPOSE_TO_CLIENT_CODE
85 * Index AMs that support ordered scans must support these two indoption
86 * bits. Otherwise, the content of the per-column indoption fields is
87 * open for future definition.
89#define INDOPTION_DESC 0x0001 /* values are in reverse order */
90#define INDOPTION_NULLS_FIRST 0x0002 /* NULLs are first instead of last */
92#endif /* EXPOSE_TO_CLIENT_CODE */
94#endif /* PG_INDEX_H */
#define BKI_LOOKUP(catalog)
#define BKI_LOOKUP_OPT(catalog)
#define BKI_FORCE_NOT_NULL
DECLARE_ARRAY_FOREIGN_KEY_OPT((indrelid, indkey), pg_attribute,(attrelid, attnum))
MAKE_SYSCACHE(INDEXRELID, pg_index_indexrelid_index, 64)
CATALOG(pg_index, 2610, IndexRelationId) BKI_SCHEMA_MACRO
DECLARE_TOAST_WITH_MACRO(pg_index, 6351, 6352, PgIndexToastTable, PgIndexToastIndex)
FormData_pg_index * Form_pg_index
DECLARE_UNIQUE_INDEX_PKEY(pg_index_indexrelid_index, 2679, IndexRelidIndexId, pg_index, btree(indexrelid oid_ops))
DECLARE_INDEX(pg_index_indrelid_index, 2678, IndexIndrelidIndexId, pg_index, btree(indrelid oid_ops))