63 elog(
ERROR,
"cache lookup failed for operator class %u", opclassoid);
66 opfamilyoid = classform->opcfamily;
67 opcintype = classform->opcintype;
68 opckeytype = classform->opckeytype;
69 opclassname =
NameStr(classform->opcname);
90 if (procform->amproclefttype != procform->amprocrighttype)
93 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
94 errmsg(
"operator family \"%s\" of access method %s contains support function %s with different left and right input types",
95 opfamilyname,
"spgist",
101 switch (procform->amprocnum)
105 2, 2, INTERNALOID, INTERNALOID);
106 configIn.
attType = procform->amproclefttype;
107 memset(&configOut, 0,
sizeof(configOut));
113 configOutLefttype = procform->amproclefttype;
114 configOutRighttype = procform->amprocrighttype;
118 configOutLeafType = opckeytype;
120 configOutLeafType = procform->amproclefttype;
124 configOutLeafType != configOut.
leafType)
127 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
128 errmsg(
"SP-GiST leaf data type %s does not match declared type %s",
132 configOutLeafType = configOut.
leafType;
140 if (configOutLeafType == configIn.
attType)
142 foreach(lc, grouplist)
146 if (group->
lefttype == procform->amproclefttype &&
147 group->
righttype == procform->amprocrighttype)
160 2, 2, INTERNALOID, INTERNALOID);
164 2, 2, INTERNALOID, INTERNALOID);
167 if (configOutLefttype != procform->amproclefttype ||
168 configOutRighttype != procform->amprocrighttype)
172 configOutLeafType,
true,
173 1, 1, procform->amproclefttype);
180 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
181 errmsg(
"operator family \"%s\" of access method %s contains function %s with invalid support number %d",
182 opfamilyname,
"spgist",
184 procform->amprocnum)));
192 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
193 errmsg(
"operator family \"%s\" of access method %s contains function %s with wrong signature for support number %d",
194 opfamilyname,
"spgist",
196 procform->amprocnum)));
209 if (oprform->amopstrategy < 1 || oprform->amopstrategy > 63)
212 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
213 errmsg(
"operator family \"%s\" of access method %s contains operator %s with invalid strategy number %d",
214 opfamilyname,
"spgist",
216 oprform->amopstrategy)));
221 if (oprform->amoppurpose != AMOP_SEARCH)
228 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
229 errmsg(
"operator family \"%s\" of access method %s contains invalid ORDER BY specification for operator %s",
230 opfamilyname,
"spgist",
236 op_rettype = BOOLOID;
240 oprform->amoplefttype,
241 oprform->amoprighttype))
244 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
245 errmsg(
"operator family \"%s\" of access method %s contains operator %s with wrong signature",
246 opfamilyname,
"spgist",
254 foreach(lc, grouplist)
259 if (thisgroup->
lefttype == opcintype &&
261 opclassgroup = thisgroup;
271 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
272 errmsg(
"operator family \"%s\" of access method %s is missing operator(s) for types %s and %s",
273 opfamilyname,
"spgist",
293 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
294 errmsg(
"operator family \"%s\" of access method %s is missing support function %d for type %s",
295 opfamilyname,
"spgist",
i,
306 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
307 errmsg(
"operator class \"%s\" of access method %s is missing operator(s)",
308 opclassname,
"spgist")));
338 foreach(lc, operators)
377 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
378 errmsg(
"support function number %d is invalid for access method %s",
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 opfamily_can_sort_type(Oid opfamilyoid, Oid datatypeoid)
bool check_amoptsproc_signature(Oid funcid)
#define OidIsValid(objectId)
void ReleaseCatCacheList(CatCList *list)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define OidFunctionCall2(functionId, arg1, arg2)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *tuple)
Oid get_op_rettype(Oid opno)
char * get_opfamily_name(Oid opfid, bool missing_ok)
FormData_pg_amop * Form_pg_amop
FormData_pg_amproc * Form_pg_amproc
FormData_pg_opclass * Form_pg_opclass
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
static const struct fns functions
char * format_procedure(Oid procedure_oid)
char * format_operator(Oid operator_oid)
#define SPGIST_OPTIONS_PROC
#define SPGIST_COMPRESS_PROC
#define SPGIST_CHOOSE_PROC
#define SPGIST_LEAF_CONSISTENT_PROC
#define SPGIST_CONFIG_PROC
#define SPGIST_PICKSPLIT_PROC
#define SPGIST_INNER_CONSISTENT_PROC
bool spgvalidate(Oid opclassoid)
void spgadjustmembers(Oid opfamilyoid, Oid opclassoid, List *operators, List *functions)
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define SearchSysCacheList1(cacheId, key1)