Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*-------------------------------------------------------------------------
 *
 * pg_operator.h
 *    definition of the "operator" system catalog (pg_operator)
 *
 *
 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/catalog/pg_operator.h
 *
 * NOTES
 *    The Catalog.pm module reads this file and derives schema
 *    information.
 *
 *-------------------------------------------------------------------------
 */
#ifndef PG_OPERATOR_H
#define PG_OPERATOR_H
 
#include "catalog/genbki.h"
#include "catalog/objectaddress.h"
#include "catalog/pg_operator_d.h"  /* IWYU pragma: export */
#include "nodes/pg_list.h"
 
/* ----------------
 *      pg_operator definition.  cpp turns this into
 *      typedef struct FormData_pg_operator
 * ----------------
 */
BEGIN_CATALOG_STRUCT
 
CATALOG(pg_operator,2617,OperatorRelationId)
{
    Oid         oid;            /* oid */
 
    /* name of operator */
    NameData    oprname;
 
    /* OID of namespace containing this oper */
    Oid         oprnamespace BKI_DEFAULT(pg_catalog) BKI_LOOKUP(pg_namespace);
 
    /* operator owner */
    Oid         oprowner BKI_DEFAULT(POSTGRES) BKI_LOOKUP(pg_authid);
 
    /* 'l' for prefix or 'b' for infix */
    char        oprkind BKI_DEFAULT(b);
 
    /* can be used in merge join? */
    bool        oprcanmerge BKI_DEFAULT(f);
 
    /* can be used in hash join? */
    bool        oprcanhash BKI_DEFAULT(f);
 
    /* left arg type, or 0 if prefix operator */
    Oid         oprleft BKI_LOOKUP_OPT(pg_type);
 
    /* right arg type */
    Oid         oprright BKI_LOOKUP(pg_type);
 
    /* result datatype; can be 0 in a "shell" operator */
    Oid         oprresult BKI_LOOKUP_OPT(pg_type);
 
    /* OID of commutator oper, or 0 if none */
    Oid         oprcom BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_operator);
 
    /* OID of negator oper, or 0 if none */
    Oid         oprnegate BKI_DEFAULT(0) BKI_LOOKUP_OPT(pg_operator);
 
    /* OID of underlying function; can be 0 in a "shell" operator */
    regproc     oprcode BKI_LOOKUP_OPT(pg_proc);
 
    /* OID of restriction estimator, or 0 */
    regproc     oprrest BKI_DEFAULT(-) BKI_LOOKUP_OPT(pg_proc);
 
    /* OID of join estimator, or 0 */
    regproc     oprjoin BKI_DEFAULT(-) BKI_LOOKUP_OPT(pg_proc);
} FormData_pg_operator;
 
END_CATALOG_STRUCT
 
/* ----------------
 *      Form_pg_operator corresponds to a pointer to a tuple with
 *      the format of pg_operator relation.
 * ----------------
 */
typedef FormData_pg_operator *Form_pg_operator;
 
DECLARE_UNIQUE_INDEX_PKEY(pg_operator_oid_index, 2688, OperatorOidIndexId, pg_operator, btree(oid oid_ops));
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));
 
MAKE_SYSCACHE(OPEROID, pg_operator_oid_index, 32);
MAKE_SYSCACHE(OPERNAMENSP, pg_operator_oprname_l_r_n_index, 256);
 
extern Oid  OperatorLookup(List *operatorName,
                           Oid leftObjectId,
                           Oid rightObjectId,
                           bool *defined);
 
extern 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);
 
extern ObjectAddress makeOperatorDependencies(HeapTuple tuple,
                                              bool makeExtensionDep,
                                              bool isUpdate);
 
extern void OperatorValidateParams(Oid leftTypeId,
                                   Oid rightTypeId,
                                   Oid operResultType,
                                   bool hasCommutator,
                                   bool hasNegator,
                                   bool hasRestrictionSelectivity,
                                   bool hasJoinSelectivity,
                                   bool canMerge,
                                   bool canHash);
 
extern void UpdateOperatorLinks(Oid baseId, Oid commId, Oid negId,
                                Oid oprResultId, bool isDelete);
 
extern void OperatorUpd(Oid baseId, Oid commId, Oid negId, bool isDelete);
 
#endif                          /* PG_OPERATOR_H */