pgvector.git / summary / log / commit / refs
commit a03dc5b7d0aad1feb3ca41f8da5bfb5c70f54811
Author: Andrew Kane <andrew@ankane.org>
Date: Sat Apr 05 18:31:57 2025 +0000
Added fields to IndexAmRoutine for Postgres 18 [skip ci]
src/hnsw.c | 13 +++++++++++++
src/ivfflat.c | 13 +++++++++++++
2 files changed, 26 insertions(+)
diff --git a/src/hnsw.c b/src/hnsw.c
index 5bfc6193..ec7c9885 100644
--- a/src/hnsw.c
+++ b/src/hnsw.c
@@ -259,6 +259,11 @@ hnswhandler(PG_FUNCTION_ARGS)
amroutine->amoptsprocnum = 0;
amroutine->amcanorder = false;
amroutine->amcanorderbyop = true;
+#if PG_VERSION_NUM >= 180000
+ amroutine->amcanhash = false;
+ amroutine->amconsistentequality = false;
+ amroutine->amconsistentordering = false;
+#endif
amroutine->amcanbackward = false; /* can change direction mid-scan */
amroutine->amcanunique = false;
amroutine->amcanmulticol = false;
@@ -291,6 +296,9 @@ hnswhandler(PG_FUNCTION_ARGS)
amroutine->amvacuumcleanup = hnswvacuumcleanup;
amroutine->amcanreturn = NULL;
amroutine->amcostestimate = hnswcostestimate;
+#if PG_VERSION_NUM >= 180000
+ amroutine->amgettreeheight = NULL;
+#endif
amroutine->amoptions = hnswoptions;
amroutine->amproperty = NULL; /* TODO AMPROP_DISTANCE_ORDERABLE */
amroutine->ambuildphasename = hnswbuildphasename;
@@ -311,5 +319,10 @@ hnswhandler(PG_FUNCTION_ARGS)
amroutine->aminitparallelscan = NULL;
amroutine->amparallelrescan = NULL;
+#if PG_VERSION_NUM >= 180000
+ amroutine->amtranslatestrategy = NULL;
+ amroutine->amtranslatecmptype = NULL;
+#endif
+
PG_RETURN_POINTER(amroutine);
}
diff --git a/src/ivfflat.c b/src/ivfflat.c
index 9e8370ff..736d537d 100644
--- a/src/ivfflat.c
+++ b/src/ivfflat.c
@@ -186,6 +186,11 @@ ivfflathandler(PG_FUNCTION_ARGS)
amroutine->amoptsprocnum = 0;
amroutine->amcanorder = false;
amroutine->amcanorderbyop = true;
+#if PG_VERSION_NUM >= 180000
+ amroutine->amcanhash = false;
+ amroutine->amconsistentequality = false;
+ amroutine->amconsistentordering = false;
+#endif
amroutine->amcanbackward = false; /* can change direction mid-scan */
amroutine->amcanunique = false;
amroutine->amcanmulticol = false;
@@ -218,6 +223,9 @@ ivfflathandler(PG_FUNCTION_ARGS)
amroutine->amvacuumcleanup = ivfflatvacuumcleanup;
amroutine->amcanreturn = NULL; /* tuple not included in heapsort */
amroutine->amcostestimate = ivfflatcostestimate;
+#if PG_VERSION_NUM >= 180000
+ amroutine->amgettreeheight = NULL;
+#endif
amroutine->amoptions = ivfflatoptions;
amroutine->amproperty = NULL; /* TODO AMPROP_DISTANCE_ORDERABLE */
amroutine->ambuildphasename = ivfflatbuildphasename;
@@ -238,5 +246,10 @@ ivfflathandler(PG_FUNCTION_ARGS)
amroutine->aminitparallelscan = NULL;
amroutine->amparallelrescan = NULL;
+#if PG_VERSION_NUM >= 180000
+ amroutine->amtranslatestrategy = NULL;
+ amroutine->amtranslatecmptype = NULL;
+#endif
+
PG_RETURN_POINTER(amroutine);
}
[parent: d365aac370b3]