1 /* contrib/btree_gist/btree_gist--1.2--1.3.sql */
3 -- complain if script is sourced in psql, rather than via ALTER EXTENSION
4 \echo Use "ALTER EXTENSION btree_gist UPDATE TO '1.3'" to load this file. \quit
6 -- Add support for indexing UUID columns
8 -- define the GiST support methods
9 CREATE FUNCTION gbt_uuid_consistent(internal,uuid,int2,oid,internal)
12 LANGUAGE C IMMUTABLE STRICT;
14 CREATE FUNCTION gbt_uuid_fetch(internal)
17 LANGUAGE C IMMUTABLE STRICT;
19 CREATE FUNCTION gbt_uuid_compress(internal)
22 LANGUAGE C IMMUTABLE STRICT;
24 CREATE FUNCTION gbt_uuid_penalty(internal,internal,internal)
27 LANGUAGE C IMMUTABLE STRICT;
29 CREATE FUNCTION gbt_uuid_picksplit(internal, internal)
32 LANGUAGE C IMMUTABLE STRICT;
34 CREATE FUNCTION gbt_uuid_union(internal, internal)
37 LANGUAGE C IMMUTABLE STRICT;
39 CREATE FUNCTION gbt_uuid_same(gbtreekey32, gbtreekey32, internal)
42 LANGUAGE C IMMUTABLE STRICT;
44 -- Create the operator class
45 CREATE OPERATOR CLASS gist_uuid_ops
46 DEFAULT FOR TYPE uuid USING gist
53 FUNCTION 1 gbt_uuid_consistent (internal, uuid, int2, oid, internal),
54 FUNCTION 2 gbt_uuid_union (internal, internal),
55 FUNCTION 3 gbt_uuid_compress (internal),
56 FUNCTION 4 gbt_decompress (internal),
57 FUNCTION 5 gbt_uuid_penalty (internal, internal, internal),
58 FUNCTION 6 gbt_uuid_picksplit (internal, internal),
59 FUNCTION 7 gbt_uuid_same (gbtreekey32, gbtreekey32, internal),
62 -- These are "loose" in the opfamily for consistency with the rest of btree_gist
63 ALTER OPERATOR FAMILY gist_uuid_ops USING gist ADD
64 OPERATOR 6 <> (uuid, uuid) ,
65 FUNCTION 9 (uuid, uuid) gbt_uuid_fetch (internal) ;