Header And Logo

PostgreSQL
| The world's most advanced open source database.

pg_opclass.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * pg_opclass.h
00004  *    definition of the system "opclass" relation (pg_opclass)
00005  *    along with the relation's initial contents.
00006  *
00007  * The primary key for this table is <opcmethod, opcname, opcnamespace> ---
00008  * that is, there is a row for each valid combination of opclass name and
00009  * index access method type.  This row specifies the expected input data type
00010  * for the opclass (the type of the heap column, or the expression output type
00011  * in the case of an index expression).  Note that types binary-coercible to
00012  * the specified type will be accepted too.
00013  *
00014  * For a given <opcmethod, opcintype> pair, there can be at most one row that
00015  * has opcdefault = true; this row is the default opclass for such data in
00016  * such an index.  (This is not currently enforced by an index, because we
00017  * don't support partial indexes on system catalogs.)
00018  *
00019  * Normally opckeytype = InvalidOid (zero), indicating that the data stored
00020  * in the index is the same as the data in the indexed column.  If opckeytype
00021  * is nonzero then it indicates that a conversion step is needed to produce
00022  * the stored index data, which will be of type opckeytype (which might be
00023  * the same or different from the input datatype).  Performing such a
00024  * conversion is the responsibility of the index access method --- not all
00025  * AMs support this.
00026  *
00027  *
00028  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00029  * Portions Copyright (c) 1994, Regents of the University of California
00030  *
00031  * src/include/catalog/pg_opclass.h
00032  *
00033  * NOTES
00034  *    the genbki.pl script reads this file and generates .bki
00035  *    information from the DATA() statements.
00036  *
00037  *-------------------------------------------------------------------------
00038  */
00039 #ifndef PG_OPCLASS_H
00040 #define PG_OPCLASS_H
00041 
00042 #include "catalog/genbki.h"
00043 
00044 /* ----------------
00045  *      pg_opclass definition.  cpp turns this into
00046  *      typedef struct FormData_pg_opclass
00047  * ----------------
00048  */
00049 #define OperatorClassRelationId  2616
00050 
00051 CATALOG(pg_opclass,2616)
00052 {
00053     Oid         opcmethod;      /* index access method opclass is for */
00054     NameData    opcname;        /* name of this opclass */
00055     Oid         opcnamespace;   /* namespace of this opclass */
00056     Oid         opcowner;       /* opclass owner */
00057     Oid         opcfamily;      /* containing operator family */
00058     Oid         opcintype;      /* type of data indexed by opclass */
00059     bool        opcdefault;     /* T if opclass is default for opcintype */
00060     Oid         opckeytype;     /* type of data in index, or InvalidOid */
00061 } FormData_pg_opclass;
00062 
00063 /* ----------------
00064  *      Form_pg_opclass corresponds to a pointer to a tuple with
00065  *      the format of pg_opclass relation.
00066  * ----------------
00067  */
00068 typedef FormData_pg_opclass *Form_pg_opclass;
00069 
00070 /* ----------------
00071  *      compiler constants for pg_opclass
00072  * ----------------
00073  */
00074 #define Natts_pg_opclass                8
00075 #define Anum_pg_opclass_opcmethod       1
00076 #define Anum_pg_opclass_opcname         2
00077 #define Anum_pg_opclass_opcnamespace    3
00078 #define Anum_pg_opclass_opcowner        4
00079 #define Anum_pg_opclass_opcfamily       5
00080 #define Anum_pg_opclass_opcintype       6
00081 #define Anum_pg_opclass_opcdefault      7
00082 #define Anum_pg_opclass_opckeytype      8
00083 
00084 /* ----------------
00085  *      initial contents of pg_opclass
00086  *
00087  * Note: we hard-wire an OID only for a few entries that have to be explicitly
00088  * referenced in the C code or in built-in catalog entries.  The rest get OIDs
00089  * assigned on-the-fly during initdb.
00090  * ----------------
00091  */
00092 
00093 DATA(insert (   403     abstime_ops         PGNSP PGUID  421  702 t 0 ));
00094 DATA(insert (   403     array_ops           PGNSP PGUID  397 2277 t 0 ));
00095 DATA(insert (   405     array_ops           PGNSP PGUID  627 2277 t 0 ));
00096 DATA(insert (   403     bit_ops             PGNSP PGUID  423 1560 t 0 ));
00097 DATA(insert (   403     bool_ops            PGNSP PGUID  424   16 t 0 ));
00098 DATA(insert (   403     bpchar_ops          PGNSP PGUID  426 1042 t 0 ));
00099 DATA(insert (   405     bpchar_ops          PGNSP PGUID  427 1042 t 0 ));
00100 DATA(insert (   403     bytea_ops           PGNSP PGUID  428   17 t 0 ));
00101 DATA(insert (   403     char_ops            PGNSP PGUID  429   18 t 0 ));
00102 DATA(insert (   405     char_ops            PGNSP PGUID  431   18 t 0 ));
00103 DATA(insert (   403     cidr_ops            PGNSP PGUID 1974  869 f 0 ));
00104 DATA(insert (   405     cidr_ops            PGNSP PGUID 1975  869 f 0 ));
00105 DATA(insert OID = 3122 ( 403    date_ops    PGNSP PGUID  434 1082 t 0 ));
00106 #define DATE_BTREE_OPS_OID 3122
00107 DATA(insert (   405     date_ops            PGNSP PGUID  435 1082 t 0 ));
00108 DATA(insert (   403     float4_ops          PGNSP PGUID 1970  700 t 0 ));
00109 DATA(insert (   405     float4_ops          PGNSP PGUID 1971  700 t 0 ));
00110 DATA(insert OID = 3123 ( 403    float8_ops  PGNSP PGUID 1970  701 t 0 ));
00111 #define FLOAT8_BTREE_OPS_OID 3123
00112 DATA(insert (   405     float8_ops          PGNSP PGUID 1971  701 t 0 ));
00113 DATA(insert (   403     inet_ops            PGNSP PGUID 1974  869 t 0 ));
00114 DATA(insert (   405     inet_ops            PGNSP PGUID 1975  869 t 0 ));
00115 DATA(insert OID = 1979 ( 403    int2_ops    PGNSP PGUID 1976   21 t 0 ));
00116 #define INT2_BTREE_OPS_OID 1979
00117 DATA(insert (   405     int2_ops            PGNSP PGUID 1977   21 t 0 ));
00118 DATA(insert OID = 1978 ( 403    int4_ops    PGNSP PGUID 1976   23 t 0 ));
00119 #define INT4_BTREE_OPS_OID 1978
00120 DATA(insert (   405     int4_ops            PGNSP PGUID 1977   23 t 0 ));
00121 DATA(insert OID = 3124 ( 403    int8_ops    PGNSP PGUID 1976   20 t 0 ));
00122 #define INT8_BTREE_OPS_OID 3124
00123 DATA(insert (   405     int8_ops            PGNSP PGUID 1977   20 t 0 ));
00124 DATA(insert (   403     interval_ops        PGNSP PGUID 1982 1186 t 0 ));
00125 DATA(insert (   405     interval_ops        PGNSP PGUID 1983 1186 t 0 ));
00126 DATA(insert (   403     macaddr_ops         PGNSP PGUID 1984  829 t 0 ));
00127 DATA(insert (   405     macaddr_ops         PGNSP PGUID 1985  829 t 0 ));
00128 /*
00129  * Here's an ugly little hack to save space in the system catalog indexes.
00130  * btree doesn't ordinarily allow a storage type different from input type;
00131  * but cstring and name are the same thing except for trailing padding,
00132  * and we can safely omit that within an index entry.  So we declare the
00133  * btree opclass for name as using cstring storage type.
00134  */
00135 DATA(insert (   403     name_ops            PGNSP PGUID 1986   19 t 2275 ));
00136 DATA(insert (   405     name_ops            PGNSP PGUID 1987   19 t 0 ));
00137 DATA(insert OID = 3125 ( 403    numeric_ops PGNSP PGUID 1988 1700 t 0 ));
00138 #define NUMERIC_BTREE_OPS_OID 3125
00139 DATA(insert (   405     numeric_ops         PGNSP PGUID 1998 1700 t 0 ));
00140 DATA(insert OID = 1981 ( 403    oid_ops     PGNSP PGUID 1989   26 t 0 ));
00141 #define OID_BTREE_OPS_OID 1981
00142 DATA(insert (   405     oid_ops             PGNSP PGUID 1990   26 t 0 ));
00143 DATA(insert (   403     oidvector_ops       PGNSP PGUID 1991   30 t 0 ));
00144 DATA(insert (   405     oidvector_ops       PGNSP PGUID 1992   30 t 0 ));
00145 DATA(insert (   403     record_ops          PGNSP PGUID 2994 2249 t 0 ));
00146 DATA(insert OID = 3126 ( 403    text_ops    PGNSP PGUID 1994   25 t 0 ));
00147 #define TEXT_BTREE_OPS_OID 3126
00148 DATA(insert (   405     text_ops            PGNSP PGUID 1995   25 t 0 ));
00149 DATA(insert (   403     time_ops            PGNSP PGUID 1996 1083 t 0 ));
00150 DATA(insert (   405     time_ops            PGNSP PGUID 1997 1083 t 0 ));
00151 DATA(insert OID = 3127 ( 403    timestamptz_ops PGNSP PGUID  434 1184 t 0 ));
00152 #define TIMESTAMPTZ_BTREE_OPS_OID 3127
00153 DATA(insert (   405     timestamptz_ops     PGNSP PGUID 1999 1184 t 0 ));
00154 DATA(insert (   403     timetz_ops          PGNSP PGUID 2000 1266 t 0 ));
00155 DATA(insert (   405     timetz_ops          PGNSP PGUID 2001 1266 t 0 ));
00156 DATA(insert (   403     varbit_ops          PGNSP PGUID 2002 1562 t 0 ));
00157 DATA(insert (   403     varchar_ops         PGNSP PGUID 1994   25 f 0 ));
00158 DATA(insert (   405     varchar_ops         PGNSP PGUID 1995   25 f 0 ));
00159 DATA(insert OID = 3128 ( 403    timestamp_ops   PGNSP PGUID  434 1114 t 0 ));
00160 #define TIMESTAMP_BTREE_OPS_OID 3128
00161 DATA(insert (   405     timestamp_ops       PGNSP PGUID 2040 1114 t 0 ));
00162 DATA(insert (   403     text_pattern_ops    PGNSP PGUID 2095   25 f 0 ));
00163 DATA(insert (   403     varchar_pattern_ops PGNSP PGUID 2095   25 f 0 ));
00164 DATA(insert (   403     bpchar_pattern_ops  PGNSP PGUID 2097 1042 f 0 ));
00165 DATA(insert (   403     money_ops           PGNSP PGUID 2099  790 t 0 ));
00166 DATA(insert (   405     bool_ops            PGNSP PGUID 2222   16 t 0 ));
00167 DATA(insert (   405     bytea_ops           PGNSP PGUID 2223   17 t 0 ));
00168 DATA(insert (   405     int2vector_ops      PGNSP PGUID 2224   22 t 0 ));
00169 DATA(insert (   403     tid_ops             PGNSP PGUID 2789   27 t 0 ));
00170 DATA(insert (   405     xid_ops             PGNSP PGUID 2225   28 t 0 ));
00171 DATA(insert (   405     cid_ops             PGNSP PGUID 2226   29 t 0 ));
00172 DATA(insert (   405     abstime_ops         PGNSP PGUID 2227  702 t 0 ));
00173 DATA(insert (   405     reltime_ops         PGNSP PGUID 2228  703 t 0 ));
00174 DATA(insert (   405     text_pattern_ops    PGNSP PGUID 2229   25 f 0 ));
00175 DATA(insert (   405     varchar_pattern_ops PGNSP PGUID 2229   25 f 0 ));
00176 DATA(insert (   405     bpchar_pattern_ops  PGNSP PGUID 2231 1042 f 0 ));
00177 DATA(insert (   403     reltime_ops         PGNSP PGUID 2233  703 t 0 ));
00178 DATA(insert (   403     tinterval_ops       PGNSP PGUID 2234  704 t 0 ));
00179 DATA(insert (   405     aclitem_ops         PGNSP PGUID 2235 1033 t 0 ));
00180 DATA(insert (   783     box_ops             PGNSP PGUID 2593  603 t 0 ));
00181 DATA(insert (   783     point_ops           PGNSP PGUID 1029  600 t 603 ));
00182 DATA(insert (   783     poly_ops            PGNSP PGUID 2594  604 t 603 ));
00183 DATA(insert (   783     circle_ops          PGNSP PGUID 2595  718 t 603 ));
00184 DATA(insert (   2742    _int4_ops           PGNSP PGUID 2745  1007 t 23 ));
00185 DATA(insert (   2742    _text_ops           PGNSP PGUID 2745  1009 t 25 ));
00186 DATA(insert (   2742    _abstime_ops        PGNSP PGUID 2745  1023 t 702 ));
00187 DATA(insert (   2742    _bit_ops            PGNSP PGUID 2745  1561 t 1560 ));
00188 DATA(insert (   2742    _bool_ops           PGNSP PGUID 2745  1000 t 16 ));
00189 DATA(insert (   2742    _bpchar_ops         PGNSP PGUID 2745  1014 t 1042 ));
00190 DATA(insert (   2742    _bytea_ops          PGNSP PGUID 2745  1001 t 17 ));
00191 DATA(insert (   2742    _char_ops           PGNSP PGUID 2745  1002 t 18 ));
00192 DATA(insert (   2742    _cidr_ops           PGNSP PGUID 2745  651 t 650 ));
00193 DATA(insert (   2742    _date_ops           PGNSP PGUID 2745  1182 t 1082 ));
00194 DATA(insert (   2742    _float4_ops         PGNSP PGUID 2745  1021 t 700 ));
00195 DATA(insert (   2742    _float8_ops         PGNSP PGUID 2745  1022 t 701 ));
00196 DATA(insert (   2742    _inet_ops           PGNSP PGUID 2745  1041 t 869 ));
00197 DATA(insert (   2742    _int2_ops           PGNSP PGUID 2745  1005 t 21 ));
00198 DATA(insert (   2742    _int8_ops           PGNSP PGUID 2745  1016 t 20 ));
00199 DATA(insert (   2742    _interval_ops       PGNSP PGUID 2745  1187 t 1186 ));
00200 DATA(insert (   2742    _macaddr_ops        PGNSP PGUID 2745  1040 t 829 ));
00201 DATA(insert (   2742    _name_ops           PGNSP PGUID 2745  1003 t 19 ));
00202 DATA(insert (   2742    _numeric_ops        PGNSP PGUID 2745  1231 t 1700 ));
00203 DATA(insert (   2742    _oid_ops            PGNSP PGUID 2745  1028 t 26 ));
00204 DATA(insert (   2742    _oidvector_ops      PGNSP PGUID 2745  1013 t 30 ));
00205 DATA(insert (   2742    _time_ops           PGNSP PGUID 2745  1183 t 1083 ));
00206 DATA(insert (   2742    _timestamptz_ops    PGNSP PGUID 2745  1185 t 1184 ));
00207 DATA(insert (   2742    _timetz_ops         PGNSP PGUID 2745  1270 t 1266 ));
00208 DATA(insert (   2742    _varbit_ops         PGNSP PGUID 2745  1563 t 1562 ));
00209 DATA(insert (   2742    _varchar_ops        PGNSP PGUID 2745  1015 t 1043 ));
00210 DATA(insert (   2742    _timestamp_ops      PGNSP PGUID 2745  1115 t 1114 ));
00211 DATA(insert (   2742    _money_ops          PGNSP PGUID 2745  791 t 790 ));
00212 DATA(insert (   2742    _reltime_ops        PGNSP PGUID 2745  1024 t 703 ));
00213 DATA(insert (   2742    _tinterval_ops      PGNSP PGUID 2745  1025 t 704 ));
00214 DATA(insert (   403     uuid_ops            PGNSP PGUID 2968  2950 t 0 ));
00215 DATA(insert (   405     uuid_ops            PGNSP PGUID 2969  2950 t 0 ));
00216 DATA(insert (   403     enum_ops            PGNSP PGUID 3522  3500 t 0 ));
00217 DATA(insert (   405     enum_ops            PGNSP PGUID 3523  3500 t 0 ));
00218 DATA(insert (   403     tsvector_ops        PGNSP PGUID 3626  3614 t 0 ));
00219 DATA(insert (   783     tsvector_ops        PGNSP PGUID 3655  3614 t 3642 ));
00220 DATA(insert (   2742    tsvector_ops        PGNSP PGUID 3659  3614 t 25 ));
00221 DATA(insert (   403     tsquery_ops         PGNSP PGUID 3683  3615 t 0 ));
00222 DATA(insert (   783     tsquery_ops         PGNSP PGUID 3702  3615 t 20 ));
00223 DATA(insert (   403     range_ops           PGNSP PGUID 3901  3831 t 0 ));
00224 DATA(insert (   405     range_ops           PGNSP PGUID 3903  3831 t 0 ));
00225 DATA(insert (   783     range_ops           PGNSP PGUID 3919  3831 t 0 ));
00226 DATA(insert (   4000    range_ops           PGNSP PGUID 3474  3831 t 0 ));
00227 DATA(insert (   4000    quad_point_ops      PGNSP PGUID 4015  600 t 0 ));
00228 DATA(insert (   4000    kd_point_ops        PGNSP PGUID 4016  600 f 0 ));
00229 DATA(insert (   4000    text_ops            PGNSP PGUID 4017  25 t 0 ));
00230 
00231 #endif   /* PG_OPCLASS_H */