pg_amcheck: Fix test failure on Windows with non-existing role
[pgsql.git] / src / include / catalog / pg_operator.h
blobc3ddfb28fa4f0026d9c3d49cd28278d9d2880a39
1 /*-------------------------------------------------------------------------
3 * pg_operator.h
4 * definition of the "operator" system catalog (pg_operator)
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_operator.h
12 * NOTES
13 * The Catalog.pm module reads this file and derives schema
14 * information.
16 *-------------------------------------------------------------------------
18 #ifndef PG_OPERATOR_H
19 #define PG_OPERATOR_H
21 #include "catalog/genbki.h"
22 #include "catalog/objectaddress.h"
23 #include "catalog/pg_operator_d.h" /* IWYU pragma: export */
24 #include "nodes/pg_list.h"
26 /* ----------------
27 * pg_operator definition. cpp turns this into
28 * typedef struct FormData_pg_operator
29 * ----------------
31 CATALOG(pg_operator,2617,OperatorRelationId)
33 Oid oid; /* oid */
35 /* name of operator */
36 NameData oprname;
38 /* OID of namespace containing this oper */
39 Oid oprnamespace BKI_DEFAULT(pg_catalog) BKI_LOOKUP(pg_namespace);
41 /* operator owner */
42 Oid oprowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
44 /* 'l' for prefix or 'b' for infix */
45 char oprkind BKI_DEFAULT(b);
47 /* can be used in merge join? */
48 bool oprcanmerge BKI_DEFAULT(f);
50 /* can be used in hash join? */
51 bool oprcanhash BKI_DEFAULT(f);
53 /* left arg type, or 0 if prefix operator */
54 Oid oprleft BKI_LOOKUP_OPT(pg_type);
56 /* right arg type */
57 Oid oprright BKI_LOOKUP(pg_type);
59 /* result datatype; can be 0 in a "shell" operator */
60 Oid oprresult BKI_LOOKUP_OPT(pg_type);
62 /* OID of commutator oper, or 0 if none */
63 Oid oprcom BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_operator);
65 /* OID of negator oper, or 0 if none */
66 Oid oprnegate BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_operator);
68 /* OID of underlying function; can be 0 in a "shell" operator */
69 regproc oprcode BKI_LOOKUP_OPT(pg_proc);
71 /* OID of restriction estimator, or 0 */
72 regproc oprrest BKI_DEFAULT(-) BKI_LOOKUP_OPT(pg_proc);
74 /* OID of join estimator, or 0 */
75 regproc oprjoin BKI_DEFAULT(-) BKI_LOOKUP_OPT(pg_proc);
76 } FormData_pg_operator;
78 /* ----------------
79 * Form_pg_operator corresponds to a pointer to a tuple with
80 * the format of pg_operator relation.
81 * ----------------
83 typedef FormData_pg_operator *Form_pg_operator;
85 DECLARE_UNIQUE_INDEX_PKEY(pg_operator_oid_index, 2688, OperatorOidIndexId, pg_operator, btree(oid oid_ops));
86 DECLARE_UNIQUE_INDEX(pg_operator_oprname_l_r_n_index, 2689, OperatorNameNspIndexId, pg_operator, btree(oprname name_ops, oprleft oid_ops, oprright oid_ops, oprnamespace oid_ops));
88 MAKE_SYSCACHE(OPEROID, pg_operator_oid_index, 32);
89 MAKE_SYSCACHE(OPERNAMENSP, pg_operator_oprname_l_r_n_index, 256);
91 extern Oid OperatorLookup(List *operatorName,
92 Oid leftObjectId,
93 Oid rightObjectId,
94 bool *defined);
96 extern ObjectAddress OperatorCreate(const char *operatorName,
97 Oid operatorNamespace,
98 Oid leftTypeId,
99 Oid rightTypeId,
100 Oid procedureId,
101 List *commutatorName,
102 List *negatorName,
103 Oid restrictionId,
104 Oid joinId,
105 bool canMerge,
106 bool canHash);
108 extern ObjectAddress makeOperatorDependencies(HeapTuple tuple,
109 bool makeExtensionDep,
110 bool isUpdate);
112 extern void OperatorValidateParams(Oid leftTypeId,
113 Oid rightTypeId,
114 Oid operResultType,
115 bool hasCommutator,
116 bool hasNegator,
117 bool hasRestrictionSelectivity,
118 bool hasJoinSelectivity,
119 bool canMerge,
120 bool canHash);
122 extern void OperatorUpd(Oid baseId, Oid commId, Oid negId, bool isDelete);
124 #endif /* PG_OPERATOR_H */