54 elog(
ERROR,
"cannot validate operator family without ordered data");
63 if (io < oprlist->n_members)
70 if (ip < proclist->n_members)
78 while (oprform || procform)
80 if (oprform && thisgroup &&
81 oprform->amoplefttype == thisgroup->
lefttype &&
82 oprform->amoprighttype == thisgroup->
righttype)
87 if (oprform->amopstrategy > 0 && oprform->amopstrategy < 64)
88 thisgroup->
operatorset |= ((uint64) 1) << oprform->amopstrategy;
90 if (io < oprlist->n_members)
100 if (procform && thisgroup &&
101 procform->amproclefttype == thisgroup->
lefttype &&
102 procform->amprocrighttype == thisgroup->
righttype)
107 if (procform->amprocnum > 0 && procform->amprocnum < 64)
108 thisgroup->
functionset |= ((uint64) 1) << procform->amprocnum;
110 if (ip < proclist->n_members)
124 (oprform->amoplefttype < procform->amproclefttype ||
125 (oprform->amoplefttype == procform->amproclefttype &&
126 oprform->amoprighttype < procform->amprocrighttype))))
128 thisgroup->
lefttype = oprform->amoplefttype;
129 thisgroup->
righttype = oprform->amoprighttype;
133 thisgroup->
lefttype = procform->amproclefttype;
134 thisgroup->
righttype = procform->amprocrighttype;
137 result =
lappend(result, thisgroup);
153 int minargs,
int maxargs,...)
163 elog(
ERROR,
"cache lookup failed for function %u", funcid);
166 if (procform->prorettype != restype || procform->proretset ||
167 procform->pronargs < minargs || procform->pronargs > maxargs)
171 for (
i = 0;
i < maxargs;
i++)
173 Oid argtype = va_arg(ap,
Oid);
175 if (
i >= procform->pronargs)
177 if (exact ? (argtype != procform->proargtypes.values[
i]) :
214 elog(
ERROR,
"cache lookup failed for operator %u", opno);
217 if (opform->oprresult != restype || opform->oprkind !=
'b' ||
218 opform->oprleft != lefttype || opform->oprright != righttype)
254 if (classform->opcfamily == opfamilyoid &&
255 classform->opcintype == datatypeoid)
257 result = classform->oid;
Oid opclass_for_family_datatype(Oid amoid, Oid opfamilyoid, Oid datatypeoid)
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)
#define HeapTupleIsValid(tuple)
List * lappend(List *list, void *datum)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
FormData_pg_amop * Form_pg_amop
FormData_pg_amproc * Form_pg_amproc
FormData_pg_opclass * Form_pg_opclass
FormData_pg_operator * Form_pg_operator
FormData_pg_proc * Form_pg_proc
static Datum ObjectIdGetDatum(Oid X)
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define SearchSysCacheList1(cacheId, key1)