PostgreSQL Source Code  git master
pg_operator.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pg_operator.h
4  * definition of the "operator" system catalog (pg_operator)
5  *
6  *
7  * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/pg_operator.h
11  *
12  * NOTES
13  * The Catalog.pm module reads this file and derives schema
14  * information.
15  *
16  *-------------------------------------------------------------------------
17  */
18 #ifndef PG_OPERATOR_H
19 #define PG_OPERATOR_H
20 
21 #include "catalog/genbki.h"
22 #include "catalog/objectaddress.h"
23 #include "catalog/pg_operator_d.h"
24 #include "nodes/pg_list.h"
25 
26 /* ----------------
27  * pg_operator definition. cpp turns this into
28  * typedef struct FormData_pg_operator
29  * ----------------
30  */
31 CATALOG(pg_operator,2617,OperatorRelationId)
32 {
33  Oid oid; /* oid */
34 
35  /* name of operator */
36  NameData oprname;
37 
38  /* OID of namespace containing this oper */
39  Oid oprnamespace BKI_DEFAULT(PGNSP);
40 
41  /* operator owner */
42  Oid oprowner BKI_DEFAULT(PGUID);
43 
44  /* 'l', 'r', or 'b' */
45  char oprkind BKI_DEFAULT(b);
46 
47  /* can be used in merge join? */
48  bool oprcanmerge BKI_DEFAULT(f);
49 
50  /* can be used in hash join? */
51  bool oprcanhash BKI_DEFAULT(f);
52 
53  /* left arg type, or 0 if 'l' oprkind */
54  Oid oprleft BKI_LOOKUP(pg_type);
55 
56  /* right arg type, or 0 if 'r' oprkind */
57  Oid oprright BKI_LOOKUP(pg_type);
58 
59  /* result datatype */
60  Oid oprresult BKI_LOOKUP(pg_type);
61 
62  /* OID of commutator oper, or 0 if none */
63  Oid oprcom BKI_DEFAULT(0) BKI_LOOKUP(pg_operator);
64 
65  /* OID of negator oper, or 0 if none */
66  Oid oprnegate BKI_DEFAULT(0) BKI_LOOKUP(pg_operator);
67 
68  /* OID of underlying function */
69  regproc oprcode BKI_LOOKUP(pg_proc);
70 
71  /* OID of restriction estimator, or 0 */
72  regproc oprrest BKI_DEFAULT(-) BKI_LOOKUP(pg_proc);
73 
74  /* OID of join estimator, or 0 */
75  regproc oprjoin BKI_DEFAULT(-) BKI_LOOKUP(pg_proc);
77 
78 /* ----------------
79  * Form_pg_operator corresponds to a pointer to a tuple with
80  * the format of pg_operator relation.
81  * ----------------
82  */
84 
85 
86 extern ObjectAddress OperatorCreate(const char *operatorName,
87  Oid operatorNamespace,
88  Oid leftTypeId,
89  Oid rightTypeId,
90  Oid procedureId,
91  List *commutatorName,
92  List *negatorName,
93  Oid restrictionId,
94  Oid joinId,
95  bool canMerge,
96  bool canHash);
97 
98 extern ObjectAddress makeOperatorDependencies(HeapTuple tuple, bool isUpdate);
99 
100 extern void OperatorUpd(Oid baseId, Oid commId, Oid negId, bool isDelete);
101 
102 #endif /* PG_OPERATOR_H */
CATALOG(pg_operator, 2617, OperatorRelationId)
Definition: pg_operator.h:31
unsigned int Oid
Definition: postgres_ext.h:31
#define BKI_DEFAULT(value)
Definition: genbki.h:35
ObjectAddress OperatorCreate(const char *operatorName, Oid operatorNamespace, Oid leftTypeId, Oid rightTypeId, Oid procedureId, List *commutatorName, List *negatorName, Oid restrictionId, Oid joinId, bool canMerge, bool canHash)
Definition: pg_operator.c:327
FormData_pg_operator
Definition: pg_operator.h:76
Definition: c.h:610
ObjectAddress makeOperatorDependencies(HeapTuple tuple, bool isUpdate)
Definition: pg_operator.c:773
#define BKI_LOOKUP(catalog)
Definition: genbki.h:42
void OperatorUpd(Oid baseId, Oid commId, Oid negId, bool isDelete)
Definition: pg_operator.c:654
FormData_pg_operator * Form_pg_operator
Definition: pg_operator.h:83
Oid regproc
Definition: c.h:511
Definition: pg_list.h:50