Skip to content

Commit

Permalink
add update path to 0.8.0-lanterncloud version, fixes for pg17
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Nov 5, 2024
1 parent bf10e0c commit 53cc7c9
Show file tree
Hide file tree
Showing 6 changed files with 1,012 additions and 9 deletions.
35 changes: 35 additions & 0 deletions sql/vector--0.7.4-lanterncloud--0.8.0-lanterncloud.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION vector UPDATE TO '0.8.0-lanterncloud'" to load this file. \quit

DROP CAST IF EXISTS (integer[] AS sparsevec);
DROP CAST IF EXISTS (real[] AS sparsevec);
DROP CAST IF EXISTS (double precision[] AS sparsevec);
DROP CAST IF EXISTS (numeric[] AS sparsevec);
DROP FUNCTION IF EXISTS array_to_sparsevec(integer[], integer, boolean);
DROP FUNCTION IF EXISTS array_to_sparsevec(real[], integer, boolean);
DROP FUNCTION IF EXISTS array_to_sparsevec(double precision[], integer, boolean);
DROP FUNCTION IF EXISTS array_to_sparsevec(numeric[], integer, boolean);

CREATE FUNCTION array_to_sparsevec(integer[], integer, boolean) RETURNS sparsevec
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION array_to_sparsevec(real[], integer, boolean) RETURNS sparsevec
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION array_to_sparsevec(double precision[], integer, boolean) RETURNS sparsevec
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE FUNCTION array_to_sparsevec(numeric[], integer, boolean) RETURNS sparsevec
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE CAST (integer[] AS sparsevec)
WITH FUNCTION array_to_sparsevec(integer[], integer, boolean) AS ASSIGNMENT;

CREATE CAST (real[] AS sparsevec)
WITH FUNCTION array_to_sparsevec(real[], integer, boolean) AS ASSIGNMENT;

CREATE CAST (double precision[] AS sparsevec)
WITH FUNCTION array_to_sparsevec(double precision[], integer, boolean) AS ASSIGNMENT;

CREATE CAST (numeric[] AS sparsevec)
WITH FUNCTION array_to_sparsevec(numeric[], integer, boolean) AS ASSIGNMENT;
Loading

0 comments on commit 53cc7c9

Please sign in to comment.