4 The catalog pg_index contains part of the information about indexes.
5 The rest is mostly in pg_class.
7 Table 52.26. pg_index Columns
13 indexrelid oid (references pg_class.oid)
15 The OID of the pg_class entry for this index
17 indrelid oid (references pg_class.oid)
19 The OID of the pg_class entry for the table this index is for
23 The total number of columns in the index (duplicates
24 pg_class.relnatts); this number includes both key and included
29 The number of key columns in the index, not counting any included
30 columns, which are merely stored and do not participate in the index
35 If true, this is a unique index
37 indnullsnotdistinct bool
39 This value is only used for unique indexes. If false, this unique index
40 will consider null values distinct (so the index can contain multiple
41 null values in a column, the default PostgreSQL behavior). If it is
42 true, it will consider null values to be equal (so the index can only
43 contain one null value in a column).
47 If true, this index represents the primary key of the table
48 (indisunique should always be true when this is true)
52 If true, this index supports an exclusion constraint
56 If true, the uniqueness check is enforced immediately on insertion
57 (irrelevant if indisunique is not true)
61 If true, the table was last clustered on this index
65 If true, the index is currently valid for queries. False means the
66 index is possibly incomplete: it must still be modified by
67 INSERT/UPDATE operations, but it cannot safely be used for queries. If
68 it is unique, the uniqueness property is not guaranteed true either.
72 If true, queries must not use the index until the xmin of this pg_index
73 row is below their TransactionXmin event horizon, because the table may
74 contain broken HOT chains with incompatible rows that they can see
78 If true, the index is currently ready for inserts. False means the
79 index must be ignored by INSERT/UPDATE operations.
83 If false, the index is in process of being dropped, and should be
84 ignored for all purposes (including HOT-safety decisions)
88 If true this index has been chosen as “replica identity” using ALTER
89 TABLE ... REPLICA IDENTITY USING INDEX ...
91 indkey int2vector (references pg_attribute.attnum)
93 This is an array of indnatts values that indicate which table columns
94 this index indexes. For example, a value of 1 3 would mean that the
95 first and the third table columns make up the index entries. Key
96 columns come before non-key (included) columns. A zero in this array
97 indicates that the corresponding index attribute is an expression over
98 the table columns, rather than a simple column reference.
100 indcollation oidvector (references pg_collation.oid)
102 For each column in the index key (indnkeyatts values), this contains
103 the OID of the collation to use for the index, or zero if the column is
104 not of a collatable data type.
106 indclass oidvector (references pg_opclass.oid)
108 For each column in the index key (indnkeyatts values), this contains
109 the OID of the operator class to use. See pg_opclass for details.
113 This is an array of indnkeyatts values that store per-column flag bits.
114 The meaning of the bits is defined by the index's access method.
116 indexprs pg_node_tree
118 Expression trees (in nodeToString() representation) for index
119 attributes that are not simple column references. This is a list with
120 one element for each zero entry in indkey. Null if all index attributes
121 are simple references.
125 Expression tree (in nodeToString() representation) for partial index
126 predicate. Null if not a partial index.