pg_opclass.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /*-------------------------------------------------------------------------
  2. *
  3. * pg_opclass.h
  4. * definition of the system "opclass" relation (pg_opclass)
  5. * along with the relation's initial contents.
  6. *
  7. * The primary key for this table is <opcmethod, opcname, opcnamespace> ---
  8. * that is, there is a row for each valid combination of opclass name and
  9. * index access method type. This row specifies the expected input data type
  10. * for the opclass (the type of the heap column, or the expression output type
  11. * in the case of an index expression). Note that types binary-coercible to
  12. * the specified type will be accepted too.
  13. *
  14. * For a given <opcmethod, opcintype> pair, there can be at most one row that
  15. * has opcdefault = true; this row is the default opclass for such data in
  16. * such an index. (This is not currently enforced by an index, because we
  17. * don't support partial indexes on system catalogs.)
  18. *
  19. * Normally opckeytype = InvalidOid (zero), indicating that the data stored
  20. * in the index is the same as the data in the indexed column. If opckeytype
  21. * is nonzero then it indicates that a conversion step is needed to produce
  22. * the stored index data, which will be of type opckeytype (which might be
  23. * the same or different from the input datatype). Performing such a
  24. * conversion is the responsibility of the index access method --- not all
  25. * AMs support this.
  26. *
  27. *
  28. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  29. * Portions Copyright (c) 1994, Regents of the University of California
  30. *
  31. * src/include/catalog/pg_opclass.h
  32. *
  33. * NOTES
  34. * the genbki.pl script reads this file and generates .bki
  35. * information from the DATA() statements.
  36. *
  37. *-------------------------------------------------------------------------
  38. */
  39. #ifndef PG_OPCLASS_H
  40. #define PG_OPCLASS_H
  41. #include "catalog/genbki.h"
  42. /* ----------------
  43. * pg_opclass definition. cpp turns this into
  44. * typedef struct FormData_pg_opclass
  45. * ----------------
  46. */
  47. #define OperatorClassRelationId 2616
  48. CATALOG(pg_opclass,2616)
  49. {
  50. Oid opcmethod; /* index access method opclass is for */
  51. NameData opcname; /* name of this opclass */
  52. Oid opcnamespace; /* namespace of this opclass */
  53. Oid opcowner; /* opclass owner */
  54. Oid opcfamily; /* containing operator family */
  55. Oid opcintype; /* type of data indexed by opclass */
  56. bool opcdefault; /* T if opclass is default for opcintype */
  57. Oid opckeytype; /* type of data in index, or InvalidOid */
  58. } FormData_pg_opclass;
  59. /* ----------------
  60. * Form_pg_opclass corresponds to a pointer to a tuple with
  61. * the format of pg_opclass relation.
  62. * ----------------
  63. */
  64. typedef FormData_pg_opclass *Form_pg_opclass;
  65. /* ----------------
  66. * compiler constants for pg_opclass
  67. * ----------------
  68. */
  69. #define Natts_pg_opclass 8
  70. #define Anum_pg_opclass_opcmethod 1
  71. #define Anum_pg_opclass_opcname 2
  72. #define Anum_pg_opclass_opcnamespace 3
  73. #define Anum_pg_opclass_opcowner 4
  74. #define Anum_pg_opclass_opcfamily 5
  75. #define Anum_pg_opclass_opcintype 6
  76. #define Anum_pg_opclass_opcdefault 7
  77. #define Anum_pg_opclass_opckeytype 8
  78. /* ----------------
  79. * initial contents of pg_opclass
  80. *
  81. * Note: we hard-wire an OID only for a few entries that have to be explicitly
  82. * referenced in the C code or in built-in catalog entries. The rest get OIDs
  83. * assigned on-the-fly during initdb.
  84. * ----------------
  85. */
  86. DATA(insert ( 403 abstime_ops PGNSP PGUID 421 702 t 0 ));
  87. DATA(insert ( 403 array_ops PGNSP PGUID 397 2277 t 0 ));
  88. DATA(insert ( 405 array_ops PGNSP PGUID 627 2277 t 0 ));
  89. DATA(insert ( 403 bit_ops PGNSP PGUID 423 1560 t 0 ));
  90. DATA(insert ( 403 bool_ops PGNSP PGUID 424 16 t 0 ));
  91. DATA(insert ( 403 bpchar_ops PGNSP PGUID 426 1042 t 0 ));
  92. DATA(insert ( 405 bpchar_ops PGNSP PGUID 427 1042 t 0 ));
  93. DATA(insert ( 403 bytea_ops PGNSP PGUID 428 17 t 0 ));
  94. DATA(insert ( 403 char_ops PGNSP PGUID 429 18 t 0 ));
  95. DATA(insert ( 405 char_ops PGNSP PGUID 431 18 t 0 ));
  96. DATA(insert ( 403 cidr_ops PGNSP PGUID 1974 869 f 0 ));
  97. DATA(insert ( 405 cidr_ops PGNSP PGUID 1975 869 f 0 ));
  98. DATA(insert OID = 3122 ( 403 date_ops PGNSP PGUID 434 1082 t 0 ));
  99. #define DATE_BTREE_OPS_OID 3122
  100. DATA(insert ( 405 date_ops PGNSP PGUID 435 1082 t 0 ));
  101. DATA(insert ( 403 float4_ops PGNSP PGUID 1970 700 t 0 ));
  102. DATA(insert ( 405 float4_ops PGNSP PGUID 1971 700 t 0 ));
  103. DATA(insert OID = 3123 ( 403 float8_ops PGNSP PGUID 1970 701 t 0 ));
  104. #define FLOAT8_BTREE_OPS_OID 3123
  105. DATA(insert ( 405 float8_ops PGNSP PGUID 1971 701 t 0 ));
  106. DATA(insert ( 403 inet_ops PGNSP PGUID 1974 869 t 0 ));
  107. DATA(insert ( 405 inet_ops PGNSP PGUID 1975 869 t 0 ));
  108. DATA(insert ( 783 inet_ops PGNSP PGUID 3550 869 f 0 ));
  109. DATA(insert OID = 1979 ( 403 int2_ops PGNSP PGUID 1976 21 t 0 ));
  110. #define INT2_BTREE_OPS_OID 1979
  111. DATA(insert ( 405 int2_ops PGNSP PGUID 1977 21 t 0 ));
  112. DATA(insert OID = 1978 ( 403 int4_ops PGNSP PGUID 1976 23 t 0 ));
  113. #define INT4_BTREE_OPS_OID 1978
  114. DATA(insert ( 405 int4_ops PGNSP PGUID 1977 23 t 0 ));
  115. DATA(insert OID = 3124 ( 403 int8_ops PGNSP PGUID 1976 20 t 0 ));
  116. #define INT8_BTREE_OPS_OID 3124
  117. DATA(insert ( 405 int8_ops PGNSP PGUID 1977 20 t 0 ));
  118. DATA(insert ( 403 interval_ops PGNSP PGUID 1982 1186 t 0 ));
  119. DATA(insert ( 405 interval_ops PGNSP PGUID 1983 1186 t 0 ));
  120. DATA(insert ( 403 macaddr_ops PGNSP PGUID 1984 829 t 0 ));
  121. DATA(insert ( 405 macaddr_ops PGNSP PGUID 1985 829 t 0 ));
  122. /*
  123. * Here's an ugly little hack to save space in the system catalog indexes.
  124. * btree doesn't ordinarily allow a storage type different from input type;
  125. * but cstring and name are the same thing except for trailing padding,
  126. * and we can safely omit that within an index entry. So we declare the
  127. * btree opclass for name as using cstring storage type.
  128. */
  129. DATA(insert ( 403 name_ops PGNSP PGUID 1986 19 t 2275 ));
  130. DATA(insert ( 405 name_ops PGNSP PGUID 1987 19 t 0 ));
  131. DATA(insert OID = 3125 ( 403 numeric_ops PGNSP PGUID 1988 1700 t 0 ));
  132. #define NUMERIC_BTREE_OPS_OID 3125
  133. DATA(insert ( 405 numeric_ops PGNSP PGUID 1998 1700 t 0 ));
  134. DATA(insert OID = 1981 ( 403 oid_ops PGNSP PGUID 1989 26 t 0 ));
  135. #define OID_BTREE_OPS_OID 1981
  136. DATA(insert ( 405 oid_ops PGNSP PGUID 1990 26 t 0 ));
  137. DATA(insert ( 403 oidvector_ops PGNSP PGUID 1991 30 t 0 ));
  138. DATA(insert ( 405 oidvector_ops PGNSP PGUID 1992 30 t 0 ));
  139. DATA(insert ( 403 record_ops PGNSP PGUID 2994 2249 t 0 ));
  140. DATA(insert ( 403 record_image_ops PGNSP PGUID 3194 2249 f 0 ));
  141. DATA(insert OID = 3126 ( 403 text_ops PGNSP PGUID 1994 25 t 0 ));
  142. #define TEXT_BTREE_OPS_OID 3126
  143. DATA(insert ( 405 text_ops PGNSP PGUID 1995 25 t 0 ));
  144. DATA(insert ( 403 time_ops PGNSP PGUID 1996 1083 t 0 ));
  145. DATA(insert ( 405 time_ops PGNSP PGUID 1997 1083 t 0 ));
  146. DATA(insert OID = 3127 ( 403 timestamptz_ops PGNSP PGUID 434 1184 t 0 ));
  147. #define TIMESTAMPTZ_BTREE_OPS_OID 3127
  148. DATA(insert ( 405 timestamptz_ops PGNSP PGUID 1999 1184 t 0 ));
  149. DATA(insert ( 403 timetz_ops PGNSP PGUID 2000 1266 t 0 ));
  150. DATA(insert ( 405 timetz_ops PGNSP PGUID 2001 1266 t 0 ));
  151. DATA(insert ( 403 varbit_ops PGNSP PGUID 2002 1562 t 0 ));
  152. DATA(insert ( 403 varchar_ops PGNSP PGUID 1994 25 f 0 ));
  153. DATA(insert ( 405 varchar_ops PGNSP PGUID 1995 25 f 0 ));
  154. DATA(insert OID = 3128 ( 403 timestamp_ops PGNSP PGUID 434 1114 t 0 ));
  155. #define TIMESTAMP_BTREE_OPS_OID 3128
  156. DATA(insert ( 405 timestamp_ops PGNSP PGUID 2040 1114 t 0 ));
  157. DATA(insert ( 403 text_pattern_ops PGNSP PGUID 2095 25 f 0 ));
  158. DATA(insert ( 403 varchar_pattern_ops PGNSP PGUID 2095 25 f 0 ));
  159. DATA(insert ( 403 bpchar_pattern_ops PGNSP PGUID 2097 1042 f 0 ));
  160. DATA(insert ( 403 money_ops PGNSP PGUID 2099 790 t 0 ));
  161. DATA(insert ( 405 bool_ops PGNSP PGUID 2222 16 t 0 ));
  162. DATA(insert ( 405 bytea_ops PGNSP PGUID 2223 17 t 0 ));
  163. DATA(insert ( 405 int2vector_ops PGNSP PGUID 2224 22 t 0 ));
  164. DATA(insert ( 403 tid_ops PGNSP PGUID 2789 27 t 0 ));
  165. DATA(insert ( 405 xid_ops PGNSP PGUID 2225 28 t 0 ));
  166. DATA(insert ( 405 cid_ops PGNSP PGUID 2226 29 t 0 ));
  167. DATA(insert ( 405 abstime_ops PGNSP PGUID 2227 702 t 0 ));
  168. DATA(insert ( 405 reltime_ops PGNSP PGUID 2228 703 t 0 ));
  169. DATA(insert ( 405 text_pattern_ops PGNSP PGUID 2229 25 f 0 ));
  170. DATA(insert ( 405 varchar_pattern_ops PGNSP PGUID 2229 25 f 0 ));
  171. DATA(insert ( 405 bpchar_pattern_ops PGNSP PGUID 2231 1042 f 0 ));
  172. DATA(insert ( 403 reltime_ops PGNSP PGUID 2233 703 t 0 ));
  173. DATA(insert ( 403 tinterval_ops PGNSP PGUID 2234 704 t 0 ));
  174. DATA(insert ( 405 aclitem_ops PGNSP PGUID 2235 1033 t 0 ));
  175. DATA(insert ( 783 box_ops PGNSP PGUID 2593 603 t 0 ));
  176. DATA(insert ( 783 point_ops PGNSP PGUID 1029 600 t 603 ));
  177. DATA(insert ( 783 poly_ops PGNSP PGUID 2594 604 t 603 ));
  178. DATA(insert ( 783 circle_ops PGNSP PGUID 2595 718 t 603 ));
  179. DATA(insert ( 2742 _int4_ops PGNSP PGUID 2745 1007 t 23 ));
  180. DATA(insert ( 2742 _text_ops PGNSP PGUID 2745 1009 t 25 ));
  181. DATA(insert ( 2742 _abstime_ops PGNSP PGUID 2745 1023 t 702 ));
  182. DATA(insert ( 2742 _bit_ops PGNSP PGUID 2745 1561 t 1560 ));
  183. DATA(insert ( 2742 _bool_ops PGNSP PGUID 2745 1000 t 16 ));
  184. DATA(insert ( 2742 _bpchar_ops PGNSP PGUID 2745 1014 t 1042 ));
  185. DATA(insert ( 2742 _bytea_ops PGNSP PGUID 2745 1001 t 17 ));
  186. DATA(insert ( 2742 _char_ops PGNSP PGUID 2745 1002 t 18 ));
  187. DATA(insert ( 2742 _cidr_ops PGNSP PGUID 2745 651 t 650 ));
  188. DATA(insert ( 2742 _date_ops PGNSP PGUID 2745 1182 t 1082 ));
  189. DATA(insert ( 2742 _float4_ops PGNSP PGUID 2745 1021 t 700 ));
  190. DATA(insert ( 2742 _float8_ops PGNSP PGUID 2745 1022 t 701 ));
  191. DATA(insert ( 2742 _inet_ops PGNSP PGUID 2745 1041 t 869 ));
  192. DATA(insert ( 2742 _int2_ops PGNSP PGUID 2745 1005 t 21 ));
  193. DATA(insert ( 2742 _int8_ops PGNSP PGUID 2745 1016 t 20 ));
  194. DATA(insert ( 2742 _interval_ops PGNSP PGUID 2745 1187 t 1186 ));
  195. DATA(insert ( 2742 _macaddr_ops PGNSP PGUID 2745 1040 t 829 ));
  196. DATA(insert ( 2742 _name_ops PGNSP PGUID 2745 1003 t 19 ));
  197. DATA(insert ( 2742 _numeric_ops PGNSP PGUID 2745 1231 t 1700 ));
  198. DATA(insert ( 2742 _oid_ops PGNSP PGUID 2745 1028 t 26 ));
  199. DATA(insert ( 2742 _oidvector_ops PGNSP PGUID 2745 1013 t 30 ));
  200. DATA(insert ( 2742 _time_ops PGNSP PGUID 2745 1183 t 1083 ));
  201. DATA(insert ( 2742 _timestamptz_ops PGNSP PGUID 2745 1185 t 1184 ));
  202. DATA(insert ( 2742 _timetz_ops PGNSP PGUID 2745 1270 t 1266 ));
  203. DATA(insert ( 2742 _varbit_ops PGNSP PGUID 2745 1563 t 1562 ));
  204. DATA(insert ( 2742 _varchar_ops PGNSP PGUID 2745 1015 t 1043 ));
  205. DATA(insert ( 2742 _timestamp_ops PGNSP PGUID 2745 1115 t 1114 ));
  206. DATA(insert ( 2742 _money_ops PGNSP PGUID 2745 791 t 790 ));
  207. DATA(insert ( 2742 _reltime_ops PGNSP PGUID 2745 1024 t 703 ));
  208. DATA(insert ( 2742 _tinterval_ops PGNSP PGUID 2745 1025 t 704 ));
  209. DATA(insert ( 403 uuid_ops PGNSP PGUID 2968 2950 t 0 ));
  210. DATA(insert ( 405 uuid_ops PGNSP PGUID 2969 2950 t 0 ));
  211. DATA(insert ( 403 pg_lsn_ops PGNSP PGUID 3253 3220 t 0 ));
  212. DATA(insert ( 405 pg_lsn_ops PGNSP PGUID 3254 3220 t 0 ));
  213. DATA(insert ( 403 enum_ops PGNSP PGUID 3522 3500 t 0 ));
  214. DATA(insert ( 405 enum_ops PGNSP PGUID 3523 3500 t 0 ));
  215. DATA(insert ( 403 tsvector_ops PGNSP PGUID 3626 3614 t 0 ));
  216. DATA(insert ( 783 tsvector_ops PGNSP PGUID 3655 3614 t 3642 ));
  217. DATA(insert ( 2742 tsvector_ops PGNSP PGUID 3659 3614 t 25 ));
  218. DATA(insert ( 403 tsquery_ops PGNSP PGUID 3683 3615 t 0 ));
  219. DATA(insert ( 783 tsquery_ops PGNSP PGUID 3702 3615 t 20 ));
  220. DATA(insert ( 403 range_ops PGNSP PGUID 3901 3831 t 0 ));
  221. DATA(insert ( 405 range_ops PGNSP PGUID 3903 3831 t 0 ));
  222. DATA(insert ( 783 range_ops PGNSP PGUID 3919 3831 t 0 ));
  223. DATA(insert ( 4000 range_ops PGNSP PGUID 3474 3831 t 0 ));
  224. DATA(insert ( 4000 box_ops PGNSP PGUID 5000 603 t 0 ));
  225. DATA(insert ( 4000 quad_point_ops PGNSP PGUID 4015 600 t 0 ));
  226. DATA(insert ( 4000 kd_point_ops PGNSP PGUID 4016 600 f 0 ));
  227. DATA(insert ( 4000 text_ops PGNSP PGUID 4017 25 t 0 ));
  228. DATA(insert ( 403 jsonb_ops PGNSP PGUID 4033 3802 t 0 ));
  229. DATA(insert ( 405 jsonb_ops PGNSP PGUID 4034 3802 t 0 ));
  230. DATA(insert ( 2742 jsonb_ops PGNSP PGUID 4036 3802 t 25 ));
  231. DATA(insert ( 2742 jsonb_path_ops PGNSP PGUID 4037 3802 f 23 ));
  232. /* BRIN operator classes */
  233. /* no brin opclass for bool */
  234. DATA(insert ( 3580 bytea_minmax_ops PGNSP PGUID 4064 17 t 17 ));
  235. DATA(insert ( 3580 char_minmax_ops PGNSP PGUID 4062 18 t 18 ));
  236. DATA(insert ( 3580 name_minmax_ops PGNSP PGUID 4065 19 t 19 ));
  237. DATA(insert ( 3580 int8_minmax_ops PGNSP PGUID 4054 20 t 20 ));
  238. DATA(insert ( 3580 int2_minmax_ops PGNSP PGUID 4054 21 t 21 ));
  239. DATA(insert ( 3580 int4_minmax_ops PGNSP PGUID 4054 23 t 23 ));
  240. DATA(insert ( 3580 text_minmax_ops PGNSP PGUID 4056 25 t 25 ));
  241. DATA(insert ( 3580 oid_minmax_ops PGNSP PGUID 4068 26 t 26 ));
  242. DATA(insert ( 3580 tid_minmax_ops PGNSP PGUID 4069 27 t 27 ));
  243. DATA(insert ( 3580 float4_minmax_ops PGNSP PGUID 4070 700 t 700 ));
  244. DATA(insert ( 3580 float8_minmax_ops PGNSP PGUID 4070 701 t 701 ));
  245. DATA(insert ( 3580 abstime_minmax_ops PGNSP PGUID 4072 702 t 702 ));
  246. DATA(insert ( 3580 reltime_minmax_ops PGNSP PGUID 4073 703 t 703 ));
  247. DATA(insert ( 3580 macaddr_minmax_ops PGNSP PGUID 4074 829 t 829 ));
  248. DATA(insert ( 3580 inet_minmax_ops PGNSP PGUID 4075 869 f 869 ));
  249. DATA(insert ( 3580 inet_inclusion_ops PGNSP PGUID 4102 869 t 869 ));
  250. DATA(insert ( 3580 bpchar_minmax_ops PGNSP PGUID 4076 1042 t 1042 ));
  251. DATA(insert ( 3580 time_minmax_ops PGNSP PGUID 4077 1083 t 1083 ));
  252. DATA(insert ( 3580 date_minmax_ops PGNSP PGUID 4059 1082 t 1082 ));
  253. DATA(insert ( 3580 timestamp_minmax_ops PGNSP PGUID 4059 1114 t 1114 ));
  254. DATA(insert ( 3580 timestamptz_minmax_ops PGNSP PGUID 4059 1184 t 1184 ));
  255. DATA(insert ( 3580 interval_minmax_ops PGNSP PGUID 4078 1186 t 1186 ));
  256. DATA(insert ( 3580 timetz_minmax_ops PGNSP PGUID 4058 1266 t 1266 ));
  257. DATA(insert ( 3580 bit_minmax_ops PGNSP PGUID 4079 1560 t 1560 ));
  258. DATA(insert ( 3580 varbit_minmax_ops PGNSP PGUID 4080 1562 t 1562 ));
  259. DATA(insert ( 3580 numeric_minmax_ops PGNSP PGUID 4055 1700 t 1700 ));
  260. /* no brin opclass for record, anyarray */
  261. DATA(insert ( 3580 uuid_minmax_ops PGNSP PGUID 4081 2950 t 2950 ));
  262. DATA(insert ( 3580 range_inclusion_ops PGNSP PGUID 4103 3831 t 3831 ));
  263. DATA(insert ( 3580 pg_lsn_minmax_ops PGNSP PGUID 4082 3220 t 3220 ));
  264. /* no brin opclass for enum, tsvector, tsquery, jsonb */
  265. DATA(insert ( 3580 box_inclusion_ops PGNSP PGUID 4104 603 t 603 ));
  266. /* no brin opclass for the geometric types except box */
  267. #endif /* PG_OPCLASS_H */