mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-30 17:51:18 +08:00
Added hamming_distance function
This commit is contained in:
@@ -3,3 +3,6 @@
|
||||
|
||||
-- remove this single line for Postgres < 13
|
||||
ALTER TYPE vector SET (STORAGE = external);
|
||||
|
||||
CREATE FUNCTION hamming_distance(bytea, bytea) RETURNS float8
|
||||
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
@@ -290,3 +290,8 @@ CREATE OPERATOR CLASS vector_cosine_ops
|
||||
OPERATOR 1 <=> (vector, vector) FOR ORDER BY float_ops,
|
||||
FUNCTION 1 vector_negative_inner_product(vector, vector),
|
||||
FUNCTION 2 vector_norm(vector);
|
||||
|
||||
-- bytea functions
|
||||
|
||||
CREATE FUNCTION hamming_distance(bytea, bytea) RETURNS float8
|
||||
AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
|
||||
|
||||
Reference in New Issue
Block a user