PostgreSQL Source Code git master
Loading...
Searching...
No Matches
pg_opclass.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pg_opclass.h
4 * definition of the "operator class" system catalog (pg_opclass)
5 *
6 * The primary key for this table is <opcmethod, opcname, opcnamespace> ---
7 * that is, there is a row for each valid combination of opclass name and
8 * index access method type. This row specifies the expected input data type
9 * for the opclass (the type of the heap column, or the expression output type
10 * in the case of an index expression). Note that types binary-coercible to
11 * the specified type will be accepted too.
12 *
13 * For a given <opcmethod, opcintype> pair, there can be at most one row that
14 * has opcdefault = true; this row is the default opclass for such data in
15 * such an index. (This is not currently enforced by an index, because we
16 * don't support partial indexes on system catalogs.)
17 *
18 * Normally opckeytype = InvalidOid (zero), indicating that the data stored
19 * in the index is the same as the data in the indexed column. If opckeytype
20 * is nonzero then it indicates that a conversion step is needed to produce
21 * the stored index data, which will be of type opckeytype (which might be
22 * the same or different from the input datatype). Performing such a
23 * conversion is the responsibility of the index access method --- not all
24 * AMs support this.
25 *
26 *
27 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
28 * Portions Copyright (c) 1994, Regents of the University of California
29 *
30 * src/include/catalog/pg_opclass.h
31 *
32 * NOTES
33 * The Catalog.pm module reads this file and derives schema
34 * information.
35 *
36 *-------------------------------------------------------------------------
37 */
38#ifndef PG_OPCLASS_H
39#define PG_OPCLASS_H
40
41#include "catalog/genbki.h"
42#include "catalog/pg_opclass_d.h" /* IWYU pragma: export */
43
44/* ----------------
45 * pg_opclass definition. cpp turns this into
46 * typedef struct FormData_pg_opclass
47 * ----------------
48 */
50
52{
53 Oid oid; /* oid */
54
55 /* index access method opclass is for */
56 Oid opcmethod BKI_LOOKUP(pg_am);
57
58 /* name of this opclass */
60
61 /* namespace of this opclass */
63
64 /* opclass owner */
66
67 /* containing operator family */
68 Oid opcfamily BKI_LOOKUP(pg_opfamily);
69
70 /* type of data indexed by opclass */
71 Oid opcintype BKI_LOOKUP(pg_type);
72
73 /* T if opclass is default for opcintype */
74 bool opcdefault BKI_DEFAULT(t);
75
76 /* type of data in index, or InvalidOid if same as input column type */
79
81
82/* ----------------
83 * Form_pg_opclass corresponds to a pointer to a tuple with
84 * the format of pg_opclass relation.
85 * ----------------
86 */
88
91
94
95#endif /* PG_OPCLASS_H */
#define BEGIN_CATALOG_STRUCT
Definition genbki.h:37
#define DECLARE_UNIQUE_INDEX_PKEY(name, oid, oidmacro, tblname, decl)
Definition genbki.h:105
#define BKI_LOOKUP(catalog)
Definition genbki.h:65
#define END_CATALOG_STRUCT
Definition genbki.h:38
#define BKI_DEFAULT(value)
Definition genbki.h:54
#define BKI_LOOKUP_OPT(catalog)
Definition genbki.h:66
#define DECLARE_UNIQUE_INDEX(name, oid, oidmacro, tblname, decl)
Definition genbki.h:104
#define CATALOG(name, oid, oidmacro)
Definition genbki.h:42
#define MAKE_SYSCACHE(name, idxname, nbuckets)
Definition genbki.h:146
FormData_pg_opclass
Definition pg_opclass.h:78
END_CATALOG_STRUCT typedef FormData_pg_opclass * Form_pg_opclass
Definition pg_opclass.h:87
unsigned int Oid
static int fb(int x)
Definition c.h:772