31{
32 bool result = true;
38 char *opclassname;
41 char *opfamilyname;
43 *oprlist;
48
49
52 elog(
ERROR,
"cache lookup failed for operator class %u", opclassoid);
54
55 opfamilyoid = classform->opcfamily;
56 opcintype = classform->opcintype;
57 opckeytype = classform->opckeytype;
59 opckeytype = opcintype;
60 opclassname =
NameStr(classform->opcname);
61
62
65 elog(
ERROR,
"cache lookup failed for operator family %u", opfamilyoid);
67
68 opfamilyname =
NameStr(familyform->opfname);
69
70
73
74
76 {
79 bool ok;
80
81
82
83
84
85 if (procform->amproclefttype != procform->amprocrighttype)
86 {
88 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
89 errmsg(
"bloom opfamily %s contains support procedure %s with cross-type registration",
90 opfamilyname,
92 result = false;
93 }
94
95
96
97
98
99 if (procform->amproclefttype != opcintype)
100 continue;
101
102
103 switch (procform->amprocnum)
104 {
107 1, 1, opckeytype);
108 break;
111 break;
112 default:
114 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
115 errmsg(
"bloom opfamily %s contains function %s with invalid support number %d",
116 opfamilyname,
118 procform->amprocnum)));
119 result = false;
120 continue;
121 }
122
123 if (!ok)
124 {
126 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
127 errmsg(
"gist opfamily %s contains function %s with wrong signature for support number %d",
128 opfamilyname,
130 procform->amprocnum)));
131 result = false;
132 }
133 }
134
135
137 {
140
141
142 if (oprform->amopstrategy < 1 ||
144 {
146 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
147 errmsg(
"bloom opfamily %s contains operator %s with invalid strategy number %d",
148 opfamilyname,
150 oprform->amopstrategy)));
151 result = false;
152 }
153
154
155 if (oprform->amoppurpose != AMOP_SEARCH ||
157 {
159 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
160 errmsg(
"bloom opfamily %s contains invalid ORDER BY specification for operator %s",
161 opfamilyname,
163 result = false;
164 }
165
166
168 oprform->amoplefttype,
169 oprform->amoprighttype))
170 {
172 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
173 errmsg(
"bloom opfamily %s contains operator %s with wrong signature",
174 opfamilyname,
176 result = false;
177 }
178 }
179
180
182 opclassgroup = NULL;
183 foreach(lc, grouplist)
184 {
186
187
188 if (thisgroup->
lefttype == opcintype &&
190 opclassgroup = thisgroup;
191
192
193
194
195
196
197
198
199
200 }
201
202
204 {
205 if (opclassgroup &&
207 continue;
209 continue;
211 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
212 errmsg(
"bloom opclass %s is missing support function %d",
214 result = false;
215 }
216
221
222 return result;
223}
bool check_amproc_signature(Oid funcid, Oid restype, bool exact, int minargs, int maxargs,...)
bool check_amop_signature(Oid opno, Oid restype, Oid lefttype, Oid righttype)
List * identify_opfamily_groups(CatCList *oprlist, CatCList *proclist)
bool check_amoptsproc_signature(Oid funcid)
#define BLOOM_NSTRATEGIES
#define BLOOM_OPTIONS_PROC
#define OidIsValid(objectId)
void ReleaseCatCacheList(CatCList *list)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
FormData_pg_amop * Form_pg_amop
FormData_pg_amproc * Form_pg_amproc
FormData_pg_opclass * Form_pg_opclass
FormData_pg_opfamily * Form_pg_opfamily
static Datum ObjectIdGetDatum(Oid X)
char * format_procedure(Oid procedure_oid)
char * format_operator(Oid operator_oid)
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define SearchSysCacheList1(cacheId, key1)