27 #include "utils/fmgroids.h"
65 elog(
ERROR,
"cache lookup failed for operator class %u", opclassoid);
68 opfamilyoid = classform->opcfamily;
69 opcintype = classform->opcintype;
70 opclassname =
NameStr(classform->opcname);
75 elog(
ERROR,
"cache lookup failed for operator family %u", opfamilyoid);
78 opfamilyname =
NameStr(familyform->opfname);
94 if (procform->amproclefttype != procform->amprocrighttype)
97 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
98 errmsg(
"hash opfamily %s contains support procedure %s with cross-type registration",
105 switch (procform->amprocnum)
109 procform->amproclefttype))
112 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
113 errmsg(
"hash opfamily %s contains function %s with wrong signature for support number %d",
116 procform->amprocnum)));
124 procform->amproclefttype);
129 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
130 errmsg(
"hash opfamily %s contains function %s with invalid support number %d",
133 procform->amprocnum)));
146 if (oprform->amopstrategy < 1 ||
150 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
151 errmsg(
"hash opfamily %s contains operator %s with invalid strategy number %d",
154 oprform->amopstrategy)));
163 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
164 errmsg(
"hash opfamily %s contains invalid ORDER BY specification for operator %s",
172 oprform->amoplefttype,
173 oprform->amoprighttype))
176 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
177 errmsg(
"hash opfamily %s contains operator %s with wrong signature",
188 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
189 errmsg(
"hash opfamily %s lacks support function for operator %s",
199 foreach(lc, grouplist)
204 if (thisgroup->
lefttype == opcintype &&
206 opclassgroup = thisgroup;
216 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
217 errmsg(
"hash opfamily %s is missing operator(s) for types %s and %s",
230 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
231 errmsg(
"hash opclass %s is missing operator(s)",
246 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
247 errmsg(
"hash opfamily %s is missing cross-type operator(s)",
274 elog(
ERROR,
"cache lookup failed for function %u", funcid);
277 if (procform->prorettype != restype || procform->proretset ||
278 procform->pronargs != 1)
292 if (funcid == F_HASHINT4 &&
297 else if (funcid == F_TIMESTAMP_HASH &&
300 else if (funcid == F_HASHCHAR &&
303 else if (funcid == F_HASHVARLENA &&
List * list_append_unique_oid(List *list, Oid datum)
FormData_pg_amproc * Form_pg_amproc
#define HTEqualStrategyNumber
int errcode(int sqlerrcode)
char * format_operator(Oid operator_oid)
#define HTMaxStrategyNumber
#define OidIsValid(objectId)
#define SearchSysCache1(cacheId, key1)
void ReleaseCatCacheList(CatCList *list)
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
#define ObjectIdGetDatum(X)
List * identify_opfamily_groups(CatCList *oprlist, CatCList *proclist)
static bool check_hash_func_signature(Oid funcid, Oid restype, Oid argtype)
#define SearchSysCacheList1(cacheId, key1)
#define ereport(elevel, rest)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
FormData_pg_opfamily * Form_pg_opfamily
void ReleaseSysCache(HeapTuple tuple)
FormData_pg_proc * Form_pg_proc
char * format_procedure(Oid procedure_oid)
bool list_member_oid(const List *list, Oid datum)
#define HeapTupleIsValid(tuple)
static int list_length(const List *l)
bool check_amop_signature(Oid opno, Oid restype, Oid lefttype, Oid righttype)
bool hashvalidate(Oid opclassoid)
int errmsg(const char *fmt,...)
FormData_pg_amop * Form_pg_amop
FormData_pg_opclass * Form_pg_opclass