mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-06 12:29:20 +02:00
This also enables hash join and hash aggregation on ltree columns. Tommy Pavlicek, reviewed by jian he Discussion: https://postgr.es/m/CAEhP-W9ZEoHeaP_nKnPCVd_o1c3BAUvq1gWHrq8EbkNRiS9CvQ@mail.gmail.com
24 lines
652 B
SQL
24 lines
652 B
SQL
/* contrib/ltree/ltree--1.2--1.3.sql */
|
|
|
|
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
|
|
\echo Use "ALTER EXTENSION ltree UPDATE TO '1.3'" to load this file. \quit
|
|
|
|
CREATE FUNCTION hash_ltree(ltree)
|
|
RETURNS integer
|
|
AS 'MODULE_PATHNAME'
|
|
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;
|
|
|
|
CREATE FUNCTION hash_ltree_extended(ltree, bigint)
|
|
RETURNS bigint
|
|
AS 'MODULE_PATHNAME'
|
|
LANGUAGE C STRICT IMMUTABLE PARALLEL SAFE;
|
|
|
|
CREATE OPERATOR CLASS hash_ltree_ops
|
|
DEFAULT FOR TYPE ltree USING hash
|
|
AS
|
|
OPERATOR 1 = ,
|
|
FUNCTION 1 hash_ltree(ltree),
|
|
FUNCTION 2 hash_ltree_extended(ltree, bigint);
|
|
|
|
ALTER OPERATOR =(ltree, ltree) SET (HASHES);
|