29 #include "utils/fmgroids.h"
69 elog(
ERROR,
"cache lookup failed for operator class %u", opclassoid);
72 opfamilyoid = classform->opcfamily;
73 opcintype = classform->opcintype;
74 opclassname =
NameStr(classform->opcname);
79 elog(
ERROR,
"cache lookup failed for operator family %u", opfamilyoid);
82 opfamilyname =
NameStr(familyform->opfname);
98 if (procform->amproclefttype != procform->amprocrighttype)
101 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
102 errmsg(
"operator family \"%s\" of access method %s contains support function %s with different left and right input types",
103 opfamilyname,
"hash",
109 switch (procform->amprocnum)
114 procform->amproclefttype))
117 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
118 errmsg(
"operator family \"%s\" of access method %s contains function %s with wrong signature for support number %d",
119 opfamilyname,
"hash",
121 procform->amprocnum)));
129 procform->amproclefttype);
138 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
139 errmsg(
"operator family \"%s\" of access method %s contains function %s with invalid support number %d",
140 opfamilyname,
"hash",
142 procform->amprocnum)));
155 if (oprform->amopstrategy < 1 ||
159 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
160 errmsg(
"operator family \"%s\" of access method %s contains operator %s with invalid strategy number %d",
161 opfamilyname,
"hash",
163 oprform->amopstrategy)));
168 if (oprform->amoppurpose != AMOP_SEARCH ||
172 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
173 errmsg(
"operator family \"%s\" of access method %s contains invalid ORDER BY specification for operator %s",
174 opfamilyname,
"hash",
181 oprform->amoplefttype,
182 oprform->amoprighttype))
185 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
186 errmsg(
"operator family \"%s\" of access method %s contains operator %s with wrong signature",
187 opfamilyname,
"hash",
197 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
198 errmsg(
"operator family \"%s\" of access method %s lacks support function for operator %s",
199 opfamilyname,
"hash",
208 foreach(lc, grouplist)
213 if (thisgroup->
lefttype == opcintype &&
215 opclassgroup = thisgroup;
225 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
226 errmsg(
"operator family \"%s\" of access method %s is missing operator(s) for types %s and %s",
227 opfamilyname,
"hash",
239 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
240 errmsg(
"operator class \"%s\" of access method %s is missing operator(s)",
241 opclassname,
"hash")));
255 (
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
256 errmsg(
"operator family \"%s\" of access method %s is missing cross-type operator(s)",
257 opfamilyname,
"hash")));
301 elog(
ERROR,
"cache lookup failed for function %u", funcid);
304 if (procform->prorettype != restype || procform->proretset ||
305 procform->pronargs != nargs)
319 if ((funcid == F_HASHINT4 || funcid == F_HASHINT4EXTENDED) &&
320 (argtype == DATEOID ||
321 argtype == XIDOID || argtype == CIDOID))
323 else if ((funcid == F_HASHINT8 || funcid == F_HASHINT8EXTENDED) &&
324 (argtype == XID8OID))
326 else if ((funcid == F_TIMESTAMP_HASH ||
327 funcid == F_TIMESTAMP_HASH_EXTENDED) &&
328 argtype == TIMESTAMPTZOID)
330 else if ((funcid == F_HASHCHAR || funcid == F_HASHCHAREXTENDED) &&
333 else if ((funcid == F_HASHVARLENA || funcid == F_HASHVARLENAEXTENDED) &&
341 if (nargs == 2 && procform->proargtypes.values[1] != INT8OID)
Oid opclass_for_family_datatype(Oid amoid, Oid opfamilyoid, Oid datatypeoid)
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 OidIsValid(objectId)
void ReleaseCatCacheList(CatCList *list)
elog(ERROR, "%s: %s", p2, msg)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define HASHSTANDARD_PROC
#define HASHEXTENDED_PROC
void hashadjustmembers(Oid opfamilyoid, Oid opclassoid, List *operators, List *functions)
bool hashvalidate(Oid opclassoid)
static bool check_hash_func_signature(Oid funcid, int16 amprocnum, Oid argtype)
#define HeapTupleIsValid(tuple)
bool list_member_oid(const List *list, Oid datum)
List * list_concat_copy(const List *list1, const List *list2)
List * list_append_unique_oid(List *list, Oid datum)
Oid get_opclass_input_type(Oid opclass)
bool IsBinaryCoercible(Oid srctype, Oid targettype)
FormData_pg_amop * Form_pg_amop
FormData_pg_amproc * Form_pg_amproc
static int list_length(const List *l)
FormData_pg_opclass * Form_pg_opclass
FormData_pg_opfamily * Form_pg_opfamily
FormData_pg_proc * Form_pg_proc
static Datum ObjectIdGetDatum(Oid X)
static const struct fns functions
char * format_operator(Oid operator_oid)
char * format_procedure(Oid procedure_oid)
#define HTMaxStrategyNumber
#define HTEqualStrategyNumber
CatCTup * members[FLEXIBLE_ARRAY_MEMBER]
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define SearchSysCacheList1(cacheId, key1)
void CommandCounterIncrement(void)