pgvector.git / summary / log / commit / refs
commit 30ba0cf556b7fa5ec9e8ca90d81397d31dd388df
Author: Andrew Kane <andrew@ankane.org>
Date: Thu Oct 22 21:54:50 2026 +0000
Made amvalidate functions more consistent with Postgres [skip ci]
src/hnsw.c | 10 ++++++----
src/ivfflat.c | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/hnsw.c b/src/hnsw.c
index 04b15582..6f1fa7cb 100644
--- a/src/hnsw.c
+++ b/src/hnsw.c
@@ -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)
{
diff --git a/src/ivfflat.c b/src/ivfflat.c
index 4854610c..a7a6b32d 100644
--- a/src/ivfflat.c
+++ b/src/ivfflat.c
@@ -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)
{
[parent: 1daf04915430]