Made amvalidate functions more consistent with Postgres [skip ci]

This commit is contained in:
Andrew Kane committed 2026-10-22 14:54:50 -07:00
1 parent 1daf049154
commit 30ba0cf556
2 files changed
+12 -8

No files matched your search

+6 -4
View File
@@ -310,18 +310,20 @@ hnswvalidate(Oid opclassoid)
Form_pg_amproc procform = (Form_pg_amproc) GETSTRUCT(proctup);
bool ok;
/* Check matching types */
if (procform->amproclefttype != opcintype || procform->amproclefttype != procform->amprocrighttype)
/* Check matching left/right types */
if (procform->amproclefttype != procform->amprocrighttype)
{
ereport(INFO,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("operator family \"%s\" of access method %s contains support function %s with different types",
errmsg("operator family \"%s\" of access method %s contains support function %s with different left and right input types",
opfamilyname, "hnsw",
format_procedure(procform->amproc))));
result = false;
continue;
}
if (procform->amproclefttype != opcintype)
continue;
/* Check procedure numbers and function signatures */
switch (procform->amprocnum)
{
+6 -4
View File
@@ -227,18 +227,20 @@ ivfflatvalidate(Oid opclassoid)
Form_pg_amproc procform = (Form_pg_amproc) GETSTRUCT(proctup);
bool ok;
/* Check matching types */
if (procform->amproclefttype != opcintype || procform->amproclefttype != procform->amprocrighttype)
/* Check matching left/right types */
if (procform->amproclefttype != procform->amprocrighttype)
{
ereport(INFO,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("operator family \"%s\" of access method %s contains support function %s with different types",
errmsg("operator family \"%s\" of access method %s contains support function %s with different left and right input types",
opfamilyname, "ivfflat",
format_procedure(procform->amproc))));
result = false;
continue;
}
if (procform->amproclefttype != opcintype)
continue;
/* Check procedure numbers and function signatures */
switch (procform->amprocnum)
{