diff --git a/pgvectorscale/sql/vectorscale--0.0.2--0.4.0.sql b/pgvectorscale/sql/vectorscale--0.0.2--0.4.0.sql new file mode 120000 index 0000000..5ab5368 --- /dev/null +++ b/pgvectorscale/sql/vectorscale--0.0.2--0.4.0.sql @@ -0,0 +1 @@ +vectorscale--0.3.0--0.4.0.sql \ No newline at end of file diff --git a/pgvectorscale/sql/vectorscale--0.2.0--0.4.0.sql b/pgvectorscale/sql/vectorscale--0.2.0--0.4.0.sql new file mode 120000 index 0000000..5ab5368 --- /dev/null +++ b/pgvectorscale/sql/vectorscale--0.2.0--0.4.0.sql @@ -0,0 +1 @@ +vectorscale--0.3.0--0.4.0.sql \ No newline at end of file diff --git a/pgvectorscale/sql/vectorscale--0.3.0--0.4.0.sql b/pgvectorscale/sql/vectorscale--0.3.0--0.4.0.sql new file mode 100644 index 0000000..fa1628f --- /dev/null +++ b/pgvectorscale/sql/vectorscale--0.3.0--0.4.0.sql @@ -0,0 +1,55 @@ +/* */ +/* +This file is auto generated by pgrx. + +The ordering of items is not stable, it is driven by a dependency graph. +*/ +/* */ + +/* */ +-- src/access_method/mod.rs:26 +-- vectorscale::access_method::amhandler + + CREATE OR REPLACE FUNCTION diskann_amhandler(internal) RETURNS index_am_handler PARALLEL SAFE IMMUTABLE STRICT COST 0.0001 LANGUAGE c AS '$libdir/vectorscale-0.4.0', 'amhandler_wrapper'; + + DO $$ + DECLARE + c int; + BEGIN + SELECT count(*) + INTO c + FROM pg_catalog.pg_am a + WHERE a.amname = 'diskann'; + + IF c = 0 THEN + CREATE ACCESS METHOD diskann TYPE INDEX HANDLER diskann_amhandler; + END IF; + END; + $$; +/* */ + +/* */ +-- src/access_method/mod.rs:89 +-- requires: +-- amhandler + + +DO $$ +DECLARE + c int; +BEGIN + SELECT count(*) + INTO c + FROM pg_catalog.pg_opclass c + WHERE c.opcname = 'vector_cosine_ops' + AND c.opcmethod = (SELECT oid FROM pg_catalog.pg_am am WHERE am.amname = 'diskann'); + + IF c = 0 THEN + CREATE OPERATOR CLASS vector_cosine_ops DEFAULT + FOR TYPE vector USING diskann AS + OPERATOR 1 <=> (vector, vector) FOR ORDER BY float_ops; + END IF; +END; +$$; +/* */ +