52 elog(
ERROR,
"cannot validate operator family without ordered data");
61 if (io < oprlist->n_members)
68 if (ip < proclist->n_members)
76 while (oprform || procform)
78 if (oprform && thisgroup &&
79 oprform->amoplefttype == thisgroup->
lefttype &&
80 oprform->amoprighttype == thisgroup->
righttype)
85 if (oprform->amopstrategy > 0 && oprform->amopstrategy < 64)
86 thisgroup->
operatorset |= ((uint64) 1) << oprform->amopstrategy;
88 if (io < oprlist->n_members)
98 if (procform && thisgroup &&
99 procform->amproclefttype == thisgroup->
lefttype &&
100 procform->amprocrighttype == thisgroup->
righttype)
105 if (procform->amprocnum > 0 && procform->amprocnum < 64)
106 thisgroup->
functionset |= ((uint64) 1) << procform->amprocnum;
108 if (ip < proclist->n_members)
122 (oprform->amoplefttype < procform->amproclefttype ||
123 (oprform->amoplefttype == procform->amproclefttype &&
124 oprform->amoprighttype < procform->amprocrighttype))))
126 thisgroup->
lefttype = oprform->amoplefttype;
127 thisgroup->
righttype = oprform->amoprighttype;
131 thisgroup->
lefttype = procform->amproclefttype;
132 thisgroup->
righttype = procform->amprocrighttype;
135 result =
lappend(result, thisgroup);
151 int minargs,
int maxargs,...)
161 elog(
ERROR,
"cache lookup failed for function %u", funcid);
164 if (procform->prorettype != restype || procform->proretset ||
165 procform->pronargs < minargs || procform->pronargs > maxargs)
168 va_start(ap, maxargs);
169 for (i = 0; i < maxargs; i++)
171 Oid argtype = va_arg(ap,
Oid);
173 if (i >= procform->pronargs)
175 if (exact ? (argtype != procform->proargtypes.values[i]) :
202 elog(
ERROR,
"cache lookup failed for operator %u", opno);
205 if (opform->oprresult != restype || opform->oprkind !=
'b' ||
206 opform->oprleft != lefttype || opform->oprright != righttype)
235 if (classform->opcfamily == opfamilyoid &&
236 classform->opcintype == datatypeoid)
bool opfamily_can_sort_type(Oid opfamilyoid, Oid datatypeoid)
FormData_pg_amproc * Form_pg_amproc
#define SearchSysCache1(cacheId, key1)
void ReleaseCatCacheList(CatCList *list)
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
bool check_amproc_signature(Oid funcid, Oid restype, bool exact, int minargs, int maxargs,...)
#define ObjectIdGetDatum(X)
List * identify_opfamily_groups(CatCList *oprlist, CatCList *proclist)
#define SearchSysCacheList1(cacheId, key1)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
List * lappend(List *list, void *datum)
void ReleaseSysCache(HeapTuple tuple)
FormData_pg_proc * Form_pg_proc
#define HeapTupleIsValid(tuple)
bool check_amop_signature(Oid opno, Oid restype, Oid lefttype, Oid righttype)
FormData_pg_operator* Form_pg_operator
FormData_pg_amop * Form_pg_amop
FormData_pg_opclass * Form_pg_opclass