On Wed, 23 Dec 2015 16:36:23 -0800
Paul Jungwirth <p...@illuminatedcomputing.com> wrote:

> On 12/23/2015 08:10 AM, Ildus Kurbangaliev wrote:
> > There is a more improved version of the patch. Main idea is to
> > present uuid as two uint64 values, and make comparisons and penalty
> > calculation based on these values. This approach is much faster
> > than using memcmp for uuid comparisons.  
> 
> Thank you for picking this up! I'm sorry I was not able to work on it 
> the last few months. I'm very glad to see someone wrapping it up. I'm 
> not a reviewer, but personally it looks like a good change to me.
> 
> Happy holidays,
> 
> Paul
> 
> 
> 
> 

Thanks! The patch was almost done and ready. I attached new version of
the patch with compability changes.

-- 
Ildus Kurbangaliev
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
diff --git a/contrib/btree_gist/Makefile b/contrib/btree_gist/Makefile
index a4b2cc7..43a6c5d 100644
--- a/contrib/btree_gist/Makefile
+++ b/contrib/btree_gist/Makefile
@@ -6,16 +6,16 @@ OBJS =  btree_gist.o btree_utils_num.o btree_utils_var.o btree_int2.o \
         btree_int4.o btree_int8.o btree_float4.o btree_float8.o btree_cash.o \
         btree_oid.o btree_ts.o btree_time.o btree_date.o btree_interval.o \
         btree_macaddr.o btree_inet.o btree_text.o btree_bytea.o btree_bit.o \
-        btree_numeric.o $(WIN32RES)
+        btree_numeric.o btree_uuid.o $(WIN32RES)
 
 EXTENSION = btree_gist
-DATA = btree_gist--1.1.sql btree_gist--unpackaged--1.0.sql \
-	btree_gist--1.0--1.1.sql
+DATA = btree_gist--1.2.sql btree_gist--unpackaged--1.0.sql \
+	btree_gist--1.0--1.1.sql btree_gist--1.1--1.2.sql
 PGFILEDESC = "btree_gist - B-tree equivalent GiST operator classes"
 
 REGRESS = init int2 int4 int8 float4 float8 cash oid timestamp timestamptz \
         time timetz date interval macaddr inet cidr text varchar char bytea \
-        bit varbit numeric not_equal
+        bit varbit numeric uuid not_equal
 
 SHLIB_LINK += $(filter -lm, $(LIBS))
 
diff --git a/contrib/btree_gist/btree_gist--1.1--1.2.sql b/contrib/btree_gist/btree_gist--1.1--1.2.sql
new file mode 100644
index 0000000..376e884
--- /dev/null
+++ b/contrib/btree_gist/btree_gist--1.1--1.2.sql
@@ -0,0 +1,64 @@
+/* contrib/btree_gist/btree_gist--1.1--1.2.sql */
+
+-- complain if script is sourced in psql, rather than via CREATE EXTENSION
+\echo Use "ALTER EXTENSION btree_gist UPDATE TO '1.2'" to load this file. \quit
+
+-- Add support for indexing UUID columns
+
+-- define the GiST support methods
+CREATE FUNCTION gbt_uuid_consistent(internal,uuid,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_uuid_ops
+DEFAULT FOR TYPE uuid USING gist
+AS
+	OPERATOR	1	<   ,
+	OPERATOR	2	<=  ,
+	OPERATOR	3	=   ,
+	OPERATOR	4	>=  ,
+	OPERATOR	5	>   ,
+	FUNCTION	1	gbt_uuid_consistent (internal, uuid, int2, oid, internal),
+	FUNCTION	2	gbt_uuid_union (bytea, internal),
+	FUNCTION	3	gbt_uuid_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_uuid_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_uuid_picksplit (internal, internal),
+	FUNCTION	7	gbt_uuid_same (internal, internal, internal),
+	STORAGE		gbtreekey32;
+
+ALTER OPERATOR FAMILY gist_uuid_ops USING gist ADD
+	OPERATOR	6	<>  (uuid, uuid) ,
+	FUNCTION	9 (uuid, uuid) gbt_uuid_fetch (internal) ;
diff --git a/contrib/btree_gist/btree_gist--1.1.sql b/contrib/btree_gist/btree_gist--1.1.sql
deleted file mode 100644
index cdec964..0000000
--- a/contrib/btree_gist/btree_gist--1.1.sql
+++ /dev/null
@@ -1,1570 +0,0 @@
-/* contrib/btree_gist/btree_gist--1.0.sql */
-
--- complain if script is sourced in psql, rather than via CREATE EXTENSION
-\echo Use "CREATE EXTENSION btree_gist" to load this file. \quit
-
-CREATE FUNCTION gbtreekey4_in(cstring)
-RETURNS gbtreekey4
-AS 'MODULE_PATHNAME', 'gbtreekey_in'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbtreekey4_out(gbtreekey4)
-RETURNS cstring
-AS 'MODULE_PATHNAME', 'gbtreekey_out'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE TYPE gbtreekey4 (
-	INTERNALLENGTH = 4,
-	INPUT  = gbtreekey4_in,
-	OUTPUT = gbtreekey4_out
-);
-
-CREATE FUNCTION gbtreekey8_in(cstring)
-RETURNS gbtreekey8
-AS 'MODULE_PATHNAME', 'gbtreekey_in'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbtreekey8_out(gbtreekey8)
-RETURNS cstring
-AS 'MODULE_PATHNAME', 'gbtreekey_out'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE TYPE gbtreekey8 (
-	INTERNALLENGTH = 8,
-	INPUT  = gbtreekey8_in,
-	OUTPUT = gbtreekey8_out
-);
-
-CREATE FUNCTION gbtreekey16_in(cstring)
-RETURNS gbtreekey16
-AS 'MODULE_PATHNAME', 'gbtreekey_in'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbtreekey16_out(gbtreekey16)
-RETURNS cstring
-AS 'MODULE_PATHNAME', 'gbtreekey_out'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE TYPE gbtreekey16 (
-	INTERNALLENGTH = 16,
-	INPUT  = gbtreekey16_in,
-	OUTPUT = gbtreekey16_out
-);
-
-CREATE FUNCTION gbtreekey32_in(cstring)
-RETURNS gbtreekey32
-AS 'MODULE_PATHNAME', 'gbtreekey_in'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbtreekey32_out(gbtreekey32)
-RETURNS cstring
-AS 'MODULE_PATHNAME', 'gbtreekey_out'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE TYPE gbtreekey32 (
-	INTERNALLENGTH = 32,
-	INPUT  = gbtreekey32_in,
-	OUTPUT = gbtreekey32_out
-);
-
-CREATE FUNCTION gbtreekey_var_in(cstring)
-RETURNS gbtreekey_var
-AS 'MODULE_PATHNAME', 'gbtreekey_in'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbtreekey_var_out(gbtreekey_var)
-RETURNS cstring
-AS 'MODULE_PATHNAME', 'gbtreekey_out'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE TYPE gbtreekey_var (
-	INTERNALLENGTH = VARIABLE,
-	INPUT  = gbtreekey_var_in,
-	OUTPUT = gbtreekey_var_out,
-	STORAGE = EXTENDED
-);
-
---distance operators
-
-CREATE FUNCTION cash_dist(money, money)
-RETURNS money
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = money,
-	RIGHTARG = money,
-	PROCEDURE = cash_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION date_dist(date, date)
-RETURNS int4
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = date,
-	RIGHTARG = date,
-	PROCEDURE = date_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION float4_dist(float4, float4)
-RETURNS float4
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = float4,
-	RIGHTARG = float4,
-	PROCEDURE = float4_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION float8_dist(float8, float8)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = float8,
-	RIGHTARG = float8,
-	PROCEDURE = float8_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION int2_dist(int2, int2)
-RETURNS int2
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = int2,
-	RIGHTARG = int2,
-	PROCEDURE = int2_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION int4_dist(int4, int4)
-RETURNS int4
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = int4,
-	RIGHTARG = int4,
-	PROCEDURE = int4_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION int8_dist(int8, int8)
-RETURNS int8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = int8,
-	RIGHTARG = int8,
-	PROCEDURE = int8_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION interval_dist(interval, interval)
-RETURNS interval
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = interval,
-	RIGHTARG = interval,
-	PROCEDURE = interval_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION oid_dist(oid, oid)
-RETURNS oid
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = oid,
-	RIGHTARG = oid,
-	PROCEDURE = oid_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION time_dist(time, time)
-RETURNS interval
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = time,
-	RIGHTARG = time,
-	PROCEDURE = time_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION ts_dist(timestamp, timestamp)
-RETURNS interval
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = timestamp,
-	RIGHTARG = timestamp,
-	PROCEDURE = ts_dist,
-	COMMUTATOR = '<->'
-);
-
-CREATE FUNCTION tstz_dist(timestamptz, timestamptz)
-RETURNS interval
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE OPERATOR <-> (
-	LEFTARG = timestamptz,
-	RIGHTARG = timestamptz,
-	PROCEDURE = tstz_dist,
-	COMMUTATOR = '<->'
-);
-
-
---
---
---
--- oid ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_oid_consistent(internal,oid,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_oid_distance(internal,oid,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_oid_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_oid_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_decompress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_var_decompress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_var_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_oid_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_oid_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_oid_union(bytea, internal)
-RETURNS gbtreekey8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_oid_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_oid_ops
-DEFAULT FOR TYPE oid USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_oid_consistent (internal, oid, int2, oid, internal),
-	FUNCTION	2	gbt_oid_union (bytea, internal),
-	FUNCTION	3	gbt_oid_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_oid_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_oid_picksplit (internal, internal),
-	FUNCTION	7	gbt_oid_same (internal, internal, internal),
-	STORAGE		gbtreekey8;
-
--- Add operators that are new in 9.1.  We do it like this, leaving them
--- "loose" in the operator family rather than bound into the opclass, because
--- that's the only state that can be reproduced during an upgrade from 9.0.
-ALTER OPERATOR FAMILY gist_oid_ops USING gist ADD
-	OPERATOR	6	<> (oid, oid) ,
-	OPERATOR	15	<-> (oid, oid) FOR ORDER BY pg_catalog.oid_ops ,
-	FUNCTION	8 (oid, oid) gbt_oid_distance (internal, oid, int2, oid) ,
-	-- Also add support function for index-only-scans, added in 9.5.
-	FUNCTION	9 (oid, oid) gbt_oid_fetch (internal) ;
-
-
---
---
---
--- int2 ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_int2_consistent(internal,int2,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int2_distance(internal,int2,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int2_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int2_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int2_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int2_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int2_union(bytea, internal)
-RETURNS gbtreekey4
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int2_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_int2_ops
-DEFAULT FOR TYPE int2 USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_int2_consistent (internal, int2, int2, oid, internal),
-	FUNCTION	2	gbt_int2_union (bytea, internal),
-	FUNCTION	3	gbt_int2_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_int2_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_int2_picksplit (internal, internal),
-	FUNCTION	7	gbt_int2_same (internal, internal, internal),
-	STORAGE		gbtreekey4;
-
-ALTER OPERATOR FAMILY gist_int2_ops USING gist ADD
-	OPERATOR	6	<> (int2, int2) ,
-	OPERATOR	15	<-> (int2, int2) FOR ORDER BY pg_catalog.integer_ops ,
-	FUNCTION	8 (int2, int2) gbt_int2_distance (internal, int2, int2, oid) ,
-	FUNCTION	9 (int2, int2) gbt_int2_fetch (internal) ;
-
---
---
---
--- int4 ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_int4_consistent(internal,int4,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int4_distance(internal,int4,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int4_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int4_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int4_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int4_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int4_union(bytea, internal)
-RETURNS gbtreekey8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int4_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_int4_ops
-DEFAULT FOR TYPE int4 USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_int4_consistent (internal, int4, int2, oid, internal),
-	FUNCTION	2	gbt_int4_union (bytea, internal),
-	FUNCTION	3	gbt_int4_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_int4_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_int4_picksplit (internal, internal),
-	FUNCTION	7	gbt_int4_same (internal, internal, internal),
-	STORAGE		gbtreekey8;
-
-ALTER OPERATOR FAMILY gist_int4_ops USING gist ADD
-	OPERATOR	6	<> (int4, int4) ,
-	OPERATOR	15	<-> (int4, int4) FOR ORDER BY pg_catalog.integer_ops ,
-	FUNCTION	8 (int4, int4) gbt_int4_distance (internal, int4, int2, oid) ,
-	FUNCTION	9 (int4, int4) gbt_int4_fetch (internal) ;
-
-
---
---
---
--- int8 ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_int8_consistent(internal,int8,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int8_distance(internal,int8,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int8_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int8_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int8_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int8_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int8_union(bytea, internal)
-RETURNS gbtreekey16
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_int8_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_int8_ops
-DEFAULT FOR TYPE int8 USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_int8_consistent (internal, int8, int2, oid, internal),
-	FUNCTION	2	gbt_int8_union (bytea, internal),
-	FUNCTION	3	gbt_int8_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_int8_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_int8_picksplit (internal, internal),
-	FUNCTION	7	gbt_int8_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_int8_ops USING gist ADD
-	OPERATOR	6	<> (int8, int8) ,
-	OPERATOR	15	<-> (int8, int8) FOR ORDER BY pg_catalog.integer_ops ,
-	FUNCTION	8 (int8, int8) gbt_int8_distance (internal, int8, int2, oid) ,
-	FUNCTION	9 (int8, int8) gbt_int8_fetch (internal) ;
-
---
---
---
--- float4 ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_float4_consistent(internal,float4,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float4_distance(internal,float4,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float4_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float4_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float4_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float4_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float4_union(bytea, internal)
-RETURNS gbtreekey8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float4_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_float4_ops
-DEFAULT FOR TYPE float4 USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_float4_consistent (internal, float4, int2, oid, internal),
-	FUNCTION	2	gbt_float4_union (bytea, internal),
-	FUNCTION	3	gbt_float4_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_float4_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_float4_picksplit (internal, internal),
-	FUNCTION	7	gbt_float4_same (internal, internal, internal),
-	STORAGE		gbtreekey8;
-
-ALTER OPERATOR FAMILY gist_float4_ops USING gist ADD
-	OPERATOR	6	<> (float4, float4) ,
-	OPERATOR	15	<-> (float4, float4) FOR ORDER BY pg_catalog.float_ops ,
-	FUNCTION	8 (float4, float4) gbt_float4_distance (internal, float4, int2, oid) ,
-	FUNCTION	9 (float4, float4) gbt_float4_fetch (internal) ;
-
---
---
---
--- float8 ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_float8_consistent(internal,float8,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float8_distance(internal,float8,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float8_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float8_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float8_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float8_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float8_union(bytea, internal)
-RETURNS gbtreekey16
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_float8_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_float8_ops
-DEFAULT FOR TYPE float8 USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_float8_consistent (internal, float8, int2, oid, internal),
-	FUNCTION	2	gbt_float8_union (bytea, internal),
-	FUNCTION	3	gbt_float8_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_float8_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_float8_picksplit (internal, internal),
-	FUNCTION	7	gbt_float8_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_float8_ops USING gist ADD
-	OPERATOR	6	<> (float8, float8) ,
-	OPERATOR	15	<-> (float8, float8) FOR ORDER BY pg_catalog.float_ops ,
-	FUNCTION	8 (float8, float8) gbt_float8_distance (internal, float8, int2, oid) ,
-	FUNCTION	9 (float8, float8) gbt_float8_fetch (internal) ;
-
---
---
---
--- timestamp ops
---
---
---
-
-CREATE FUNCTION gbt_ts_consistent(internal,timestamp,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_ts_distance(internal,timestamp,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_tstz_distance(internal,timestamptz,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_ts_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_tstz_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_ts_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_ts_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_ts_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_ts_union(bytea, internal)
-RETURNS gbtreekey16
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_ts_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_timestamp_ops
-DEFAULT FOR TYPE timestamp USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_ts_consistent (internal, timestamp, int2, oid, internal),
-	FUNCTION	2	gbt_ts_union (bytea, internal),
-	FUNCTION	3	gbt_ts_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_ts_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_ts_picksplit (internal, internal),
-	FUNCTION	7	gbt_ts_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_timestamp_ops USING gist ADD
-	OPERATOR	6	<> (timestamp, timestamp) ,
-	OPERATOR	15	<-> (timestamp, timestamp) FOR ORDER BY pg_catalog.interval_ops ,
-	FUNCTION	8 (timestamp, timestamp) gbt_ts_distance (internal, timestamp, int2, oid) ,
-	FUNCTION	9 (timestamp, timestamp) gbt_ts_fetch (internal) ;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_timestamptz_ops
-DEFAULT FOR TYPE timestamptz USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_tstz_consistent (internal, timestamptz, int2, oid, internal),
-	FUNCTION	2	gbt_ts_union (bytea, internal),
-	FUNCTION	3	gbt_tstz_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_ts_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_ts_picksplit (internal, internal),
-	FUNCTION	7	gbt_ts_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_timestamptz_ops USING gist ADD
-	OPERATOR	6	<> (timestamptz, timestamptz) ,
-	OPERATOR	15	<-> (timestamptz, timestamptz) FOR ORDER BY pg_catalog.interval_ops ,
-	FUNCTION	8 (timestamptz, timestamptz) gbt_tstz_distance (internal, timestamptz, int2, oid) ,
-	FUNCTION	9 (timestamptz, timestamptz) gbt_ts_fetch (internal) ;
-
---
---
---
--- time ops
---
---
---
-
-CREATE FUNCTION gbt_time_consistent(internal,time,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_time_distance(internal,time,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_timetz_consistent(internal,timetz,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_time_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_timetz_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_time_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_time_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_time_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_time_union(bytea, internal)
-RETURNS gbtreekey16
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_time_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_time_ops
-DEFAULT FOR TYPE time USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_time_consistent (internal, time, int2, oid, internal),
-	FUNCTION	2	gbt_time_union (bytea, internal),
-	FUNCTION	3	gbt_time_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_time_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_time_picksplit (internal, internal),
-	FUNCTION	7	gbt_time_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_time_ops USING gist ADD
-	OPERATOR	6	<> (time, time) ,
-	OPERATOR	15	<-> (time, time) FOR ORDER BY pg_catalog.interval_ops ,
-	FUNCTION	8 (time, time) gbt_time_distance (internal, time, int2, oid) ,
-	FUNCTION	9 (time, time) gbt_time_fetch (internal) ;
-
-
-CREATE OPERATOR CLASS gist_timetz_ops
-DEFAULT FOR TYPE timetz USING gist
-AS
-	OPERATOR	1	<   ,
-	OPERATOR	2	<=  ,
-	OPERATOR	3	=   ,
-	OPERATOR	4	>=  ,
-	OPERATOR	5	>   ,
-	FUNCTION	1	gbt_timetz_consistent (internal, timetz, int2, oid, internal),
-	FUNCTION	2	gbt_time_union (bytea, internal),
-	FUNCTION	3	gbt_timetz_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_time_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_time_picksplit (internal, internal),
-	FUNCTION	7	gbt_time_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_timetz_ops USING gist ADD
-	OPERATOR	6	<> (timetz, timetz) ;
-	-- no 'fetch' function, as the compress function is lossy.
-
-
---
---
---
--- date ops
---
---
---
-
-CREATE FUNCTION gbt_date_consistent(internal,date,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_date_distance(internal,date,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_date_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_date_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_date_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_date_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_date_union(bytea, internal)
-RETURNS gbtreekey8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_date_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_date_ops
-DEFAULT FOR TYPE date USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_date_consistent (internal, date, int2, oid, internal),
-	FUNCTION	2	gbt_date_union (bytea, internal),
-	FUNCTION	3	gbt_date_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_date_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_date_picksplit (internal, internal),
-	FUNCTION	7	gbt_date_same (internal, internal, internal),
-	STORAGE		gbtreekey8;
-
-ALTER OPERATOR FAMILY gist_date_ops USING gist ADD
-	OPERATOR	6	<> (date, date) ,
-	OPERATOR	15	<-> (date, date) FOR ORDER BY pg_catalog.integer_ops ,
-	FUNCTION	8 (date, date) gbt_date_distance (internal, date, int2, oid) ,
-	FUNCTION	9 (date, date) gbt_date_fetch (internal) ;
-
-
---
---
---
--- interval ops
---
---
---
-
-CREATE FUNCTION gbt_intv_consistent(internal,interval,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_distance(internal,interval,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_decompress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_union(bytea, internal)
-RETURNS gbtreekey32
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_intv_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_interval_ops
-DEFAULT FOR TYPE interval USING gist
-AS
-	OPERATOR	1	< ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	= ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	> ,
-	FUNCTION	1	gbt_intv_consistent (internal, interval, int2, oid, internal),
-	FUNCTION	2	gbt_intv_union (bytea, internal),
-	FUNCTION	3	gbt_intv_compress (internal),
-	FUNCTION	4	gbt_intv_decompress (internal),
-	FUNCTION	5	gbt_intv_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_intv_picksplit (internal, internal),
-	FUNCTION	7	gbt_intv_same (internal, internal, internal),
-	STORAGE		gbtreekey32;
-
-ALTER OPERATOR FAMILY gist_interval_ops USING gist ADD
-	OPERATOR	6	<> (interval, interval) ,
-	OPERATOR	15	<-> (interval, interval) FOR ORDER BY pg_catalog.interval_ops ,
-	FUNCTION	8 (interval, interval) gbt_intv_distance (internal, interval, int2, oid) ,
-	FUNCTION	9 (interval, interval) gbt_intv_fetch (internal) ;
-
-
---
---
---
--- cash ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_cash_consistent(internal,money,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_cash_distance(internal,money,int2,oid)
-RETURNS float8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_cash_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_cash_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_cash_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_cash_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_cash_union(bytea, internal)
-RETURNS gbtreekey8
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_cash_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_cash_ops
-DEFAULT FOR TYPE money USING gist
-AS
-	OPERATOR	1	< ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	= ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	> ,
-	FUNCTION	1	gbt_cash_consistent (internal, money, int2, oid, internal),
-	FUNCTION	2	gbt_cash_union (bytea, internal),
-	FUNCTION	3	gbt_cash_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_cash_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_cash_picksplit (internal, internal),
-	FUNCTION	7	gbt_cash_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_cash_ops USING gist ADD
-	OPERATOR	6	<> (money, money) ,
-	OPERATOR	15	<-> (money, money) FOR ORDER BY pg_catalog.money_ops ,
-	FUNCTION	8 (money, money) gbt_cash_distance (internal, money, int2, oid) ,
-	FUNCTION	9 (money, money) gbt_cash_fetch (internal) ;
-
-
---
---
---
--- macaddr ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_macad_consistent(internal,macaddr,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_macad_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_macad_fetch(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_macad_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_macad_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_macad_union(bytea, internal)
-RETURNS gbtreekey16
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_macad_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_macaddr_ops
-DEFAULT FOR TYPE macaddr USING gist
-AS
-	OPERATOR	1	< ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	= ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	> ,
-	FUNCTION	1	gbt_macad_consistent (internal, macaddr, int2, oid, internal),
-	FUNCTION	2	gbt_macad_union (bytea, internal),
-	FUNCTION	3	gbt_macad_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_macad_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_macad_picksplit (internal, internal),
-	FUNCTION	7	gbt_macad_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_macaddr_ops USING gist ADD
-	OPERATOR	6	<> (macaddr, macaddr) ,
-	FUNCTION	9 (macaddr, macaddr) gbt_macad_fetch (internal);
-
-
---
---
---
--- text/ bpchar ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_text_consistent(internal,text,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_text_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bpchar_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_text_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_text_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_text_union(bytea, internal)
-RETURNS gbtreekey_var
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_text_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_text_ops
-DEFAULT FOR TYPE text USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_text_consistent (internal, text, int2, oid, internal),
-	FUNCTION	2	gbt_text_union (bytea, internal),
-	FUNCTION	3	gbt_text_compress (internal),
-	FUNCTION	4	gbt_var_decompress (internal),
-	FUNCTION	5	gbt_text_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_text_picksplit (internal, internal),
-	FUNCTION	7	gbt_text_same (internal, internal, internal),
-	STORAGE			gbtreekey_var;
-
-ALTER OPERATOR FAMILY gist_text_ops USING gist ADD
-	OPERATOR	6	<> (text, text) ,
-	FUNCTION	9 (text, text) gbt_var_fetch (internal) ;
-
-
----- Create the operator class
-CREATE OPERATOR CLASS gist_bpchar_ops
-DEFAULT FOR TYPE bpchar USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_bpchar_consistent (internal, bpchar , int2, oid, internal),
-	FUNCTION	2	gbt_text_union (bytea, internal),
-	FUNCTION	3	gbt_bpchar_compress (internal),
-	FUNCTION	4	gbt_var_decompress (internal),
-	FUNCTION	5	gbt_text_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_text_picksplit (internal, internal),
-	FUNCTION	7	gbt_text_same (internal, internal, internal),
-	STORAGE			gbtreekey_var;
-
-ALTER OPERATOR FAMILY gist_bpchar_ops USING gist ADD
-	OPERATOR	6	<> (bpchar, bpchar) ,
-	FUNCTION	9 (bpchar, bpchar) gbt_var_fetch (internal) ;
-
---
---
--- bytea ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_bytea_consistent(internal,bytea,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bytea_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bytea_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bytea_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bytea_union(bytea, internal)
-RETURNS gbtreekey_var
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bytea_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_bytea_ops
-DEFAULT FOR TYPE bytea USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_bytea_consistent (internal, bytea, int2, oid, internal),
-	FUNCTION	2	gbt_bytea_union (bytea, internal),
-	FUNCTION	3	gbt_bytea_compress (internal),
-	FUNCTION	4	gbt_var_decompress (internal),
-	FUNCTION	5	gbt_bytea_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_bytea_picksplit (internal, internal),
-	FUNCTION	7	gbt_bytea_same (internal, internal, internal),
-	STORAGE			gbtreekey_var;
-
-ALTER OPERATOR FAMILY gist_bytea_ops USING gist ADD
-	OPERATOR	6	<> (bytea, bytea) ,
-	FUNCTION	9 (bytea, bytea) gbt_var_fetch (internal) ;
-
-
---
---
---
--- numeric ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_numeric_consistent(internal,numeric,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_numeric_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_numeric_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_numeric_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_numeric_union(bytea, internal)
-RETURNS gbtreekey_var
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_numeric_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_numeric_ops
-DEFAULT FOR TYPE numeric USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_numeric_consistent (internal, numeric, int2, oid, internal),
-	FUNCTION	2	gbt_numeric_union (bytea, internal),
-	FUNCTION	3	gbt_numeric_compress (internal),
-	FUNCTION	4	gbt_var_decompress (internal),
-	FUNCTION	5	gbt_numeric_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_numeric_picksplit (internal, internal),
-	FUNCTION	7	gbt_numeric_same (internal, internal, internal),
-	STORAGE			gbtreekey_var;
-
-ALTER OPERATOR FAMILY gist_numeric_ops USING gist ADD
-	OPERATOR	6	<> (numeric, numeric) ,
-	FUNCTION	9 (numeric, numeric) gbt_var_fetch (internal) ;
-
-
---
---
--- bit ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_bit_consistent(internal,bit,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bit_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bit_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bit_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bit_union(bytea, internal)
-RETURNS gbtreekey_var
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_bit_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_bit_ops
-DEFAULT FOR TYPE bit USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_bit_consistent (internal, bit, int2, oid, internal),
-	FUNCTION	2	gbt_bit_union (bytea, internal),
-	FUNCTION	3	gbt_bit_compress (internal),
-	FUNCTION	4	gbt_var_decompress (internal),
-	FUNCTION	5	gbt_bit_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_bit_picksplit (internal, internal),
-	FUNCTION	7	gbt_bit_same (internal, internal, internal),
-	STORAGE			gbtreekey_var;
-
-ALTER OPERATOR FAMILY gist_bit_ops USING gist ADD
-	OPERATOR	6	<> (bit, bit) ,
-	FUNCTION	9 (bit, bit) gbt_var_fetch (internal) ;
-
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_vbit_ops
-DEFAULT FOR TYPE varbit USING gist
-AS
-	OPERATOR	1	<  ,
-	OPERATOR	2	<= ,
-	OPERATOR	3	=  ,
-	OPERATOR	4	>= ,
-	OPERATOR	5	>  ,
-	FUNCTION	1	gbt_bit_consistent (internal, bit, int2, oid, internal),
-	FUNCTION	2	gbt_bit_union (bytea, internal),
-	FUNCTION	3	gbt_bit_compress (internal),
-	FUNCTION	4	gbt_var_decompress (internal),
-	FUNCTION	5	gbt_bit_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_bit_picksplit (internal, internal),
-	FUNCTION	7	gbt_bit_same (internal, internal, internal),
-	STORAGE			gbtreekey_var;
-
-ALTER OPERATOR FAMILY gist_vbit_ops USING gist ADD
-	OPERATOR	6	<> (varbit, varbit) ,
-	FUNCTION	9 (varbit, varbit) gbt_var_fetch (internal) ;
-
-
---
---
---
--- inet/cidr ops
---
---
---
--- define the GiST support methods
-CREATE FUNCTION gbt_inet_consistent(internal,inet,int2,oid,internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_inet_compress(internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_inet_penalty(internal,internal,internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_inet_picksplit(internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_inet_union(bytea, internal)
-RETURNS gbtreekey16
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
-CREATE FUNCTION gbt_inet_same(internal, internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C IMMUTABLE STRICT;
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_inet_ops
-DEFAULT FOR TYPE inet USING gist
-AS
-	OPERATOR	1	<   ,
-	OPERATOR	2	<=  ,
-	OPERATOR	3	=   ,
-	OPERATOR	4	>=  ,
-	OPERATOR	5	>   ,
-	FUNCTION	1	gbt_inet_consistent (internal, inet, int2, oid, internal),
-	FUNCTION	2	gbt_inet_union (bytea, internal),
-	FUNCTION	3	gbt_inet_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_inet_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_inet_picksplit (internal, internal),
-	FUNCTION	7	gbt_inet_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_inet_ops USING gist ADD
-	OPERATOR	6	<>  (inet, inet) ;
-	-- no fetch support, the compress function is lossy
-
--- Create the operator class
-CREATE OPERATOR CLASS gist_cidr_ops
-DEFAULT FOR TYPE cidr USING gist
-AS
-	OPERATOR	1	<  (inet, inet)  ,
-	OPERATOR	2	<= (inet, inet)  ,
-	OPERATOR	3	=  (inet, inet)  ,
-	OPERATOR	4	>= (inet, inet)  ,
-	OPERATOR	5	>  (inet, inet)  ,
-	FUNCTION	1	gbt_inet_consistent (internal, inet, int2, oid, internal),
-	FUNCTION	2	gbt_inet_union (bytea, internal),
-	FUNCTION	3	gbt_inet_compress (internal),
-	FUNCTION	4	gbt_decompress (internal),
-	FUNCTION	5	gbt_inet_penalty (internal, internal, internal),
-	FUNCTION	6	gbt_inet_picksplit (internal, internal),
-	FUNCTION	7	gbt_inet_same (internal, internal, internal),
-	STORAGE		gbtreekey16;
-
-ALTER OPERATOR FAMILY gist_cidr_ops USING gist ADD
-	OPERATOR	6	<> (inet, inet) ;
-	-- no fetch support, the compress function is lossy
diff --git a/contrib/btree_gist/btree_gist--1.2.sql b/contrib/btree_gist/btree_gist--1.2.sql
new file mode 100644
index 0000000..b7a0dfd
--- /dev/null
+++ b/contrib/btree_gist/btree_gist--1.2.sql
@@ -0,0 +1,1636 @@
+/* contrib/btree_gist/btree_gist--1.2.sql */
+
+-- complain if script is sourced in psql, rather than via CREATE EXTENSION
+\echo Use "CREATE EXTENSION btree_gist" to load this file. \quit
+
+CREATE FUNCTION gbtreekey4_in(cstring)
+RETURNS gbtreekey4
+AS 'MODULE_PATHNAME', 'gbtreekey_in'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbtreekey4_out(gbtreekey4)
+RETURNS cstring
+AS 'MODULE_PATHNAME', 'gbtreekey_out'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE TYPE gbtreekey4 (
+	INTERNALLENGTH = 4,
+	INPUT  = gbtreekey4_in,
+	OUTPUT = gbtreekey4_out
+);
+
+CREATE FUNCTION gbtreekey8_in(cstring)
+RETURNS gbtreekey8
+AS 'MODULE_PATHNAME', 'gbtreekey_in'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbtreekey8_out(gbtreekey8)
+RETURNS cstring
+AS 'MODULE_PATHNAME', 'gbtreekey_out'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE TYPE gbtreekey8 (
+	INTERNALLENGTH = 8,
+	INPUT  = gbtreekey8_in,
+	OUTPUT = gbtreekey8_out
+);
+
+CREATE FUNCTION gbtreekey16_in(cstring)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME', 'gbtreekey_in'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbtreekey16_out(gbtreekey16)
+RETURNS cstring
+AS 'MODULE_PATHNAME', 'gbtreekey_out'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE TYPE gbtreekey16 (
+	INTERNALLENGTH = 16,
+	INPUT  = gbtreekey16_in,
+	OUTPUT = gbtreekey16_out
+);
+
+CREATE FUNCTION gbtreekey32_in(cstring)
+RETURNS gbtreekey32
+AS 'MODULE_PATHNAME', 'gbtreekey_in'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbtreekey32_out(gbtreekey32)
+RETURNS cstring
+AS 'MODULE_PATHNAME', 'gbtreekey_out'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE TYPE gbtreekey32 (
+	INTERNALLENGTH = 32,
+	INPUT  = gbtreekey32_in,
+	OUTPUT = gbtreekey32_out
+);
+
+CREATE FUNCTION gbtreekey_var_in(cstring)
+RETURNS gbtreekey_var
+AS 'MODULE_PATHNAME', 'gbtreekey_in'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbtreekey_var_out(gbtreekey_var)
+RETURNS cstring
+AS 'MODULE_PATHNAME', 'gbtreekey_out'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE TYPE gbtreekey_var (
+	INTERNALLENGTH = VARIABLE,
+	INPUT  = gbtreekey_var_in,
+	OUTPUT = gbtreekey_var_out,
+	STORAGE = EXTENDED
+);
+
+--distance operators
+
+CREATE FUNCTION cash_dist(money, money)
+RETURNS money
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = money,
+	RIGHTARG = money,
+	PROCEDURE = cash_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION date_dist(date, date)
+RETURNS int4
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = date,
+	RIGHTARG = date,
+	PROCEDURE = date_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION float4_dist(float4, float4)
+RETURNS float4
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = float4,
+	RIGHTARG = float4,
+	PROCEDURE = float4_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION float8_dist(float8, float8)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = float8,
+	RIGHTARG = float8,
+	PROCEDURE = float8_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION int2_dist(int2, int2)
+RETURNS int2
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = int2,
+	RIGHTARG = int2,
+	PROCEDURE = int2_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION int4_dist(int4, int4)
+RETURNS int4
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = int4,
+	RIGHTARG = int4,
+	PROCEDURE = int4_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION int8_dist(int8, int8)
+RETURNS int8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = int8,
+	RIGHTARG = int8,
+	PROCEDURE = int8_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION interval_dist(interval, interval)
+RETURNS interval
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = interval,
+	RIGHTARG = interval,
+	PROCEDURE = interval_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION oid_dist(oid, oid)
+RETURNS oid
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = oid,
+	RIGHTARG = oid,
+	PROCEDURE = oid_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION time_dist(time, time)
+RETURNS interval
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = time,
+	RIGHTARG = time,
+	PROCEDURE = time_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION ts_dist(timestamp, timestamp)
+RETURNS interval
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = timestamp,
+	RIGHTARG = timestamp,
+	PROCEDURE = ts_dist,
+	COMMUTATOR = '<->'
+);
+
+CREATE FUNCTION tstz_dist(timestamptz, timestamptz)
+RETURNS interval
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE OPERATOR <-> (
+	LEFTARG = timestamptz,
+	RIGHTARG = timestamptz,
+	PROCEDURE = tstz_dist,
+	COMMUTATOR = '<->'
+);
+
+
+--
+--
+--
+-- oid ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_oid_consistent(internal,oid,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_oid_distance(internal,oid,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_oid_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_oid_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_decompress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_var_decompress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_var_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_oid_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_oid_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_oid_union(bytea, internal)
+RETURNS gbtreekey8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_oid_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_oid_ops
+DEFAULT FOR TYPE oid USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_oid_consistent (internal, oid, int2, oid, internal),
+	FUNCTION	2	gbt_oid_union (bytea, internal),
+	FUNCTION	3	gbt_oid_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_oid_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_oid_picksplit (internal, internal),
+	FUNCTION	7	gbt_oid_same (internal, internal, internal),
+	STORAGE		gbtreekey8;
+
+-- Add operators that are new in 9.1.  We do it like this, leaving them
+-- "loose" in the operator family rather than bound into the opclass, because
+-- that's the only state that can be reproduced during an upgrade from 9.0.
+ALTER OPERATOR FAMILY gist_oid_ops USING gist ADD
+	OPERATOR	6	<> (oid, oid) ,
+	OPERATOR	15	<-> (oid, oid) FOR ORDER BY pg_catalog.oid_ops ,
+	FUNCTION	8 (oid, oid) gbt_oid_distance (internal, oid, int2, oid) ,
+	-- Also add support function for index-only-scans, added in 9.5.
+	FUNCTION	9 (oid, oid) gbt_oid_fetch (internal) ;
+
+
+--
+--
+--
+-- int2 ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_int2_consistent(internal,int2,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int2_distance(internal,int2,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int2_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int2_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int2_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int2_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int2_union(bytea, internal)
+RETURNS gbtreekey4
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int2_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_int2_ops
+DEFAULT FOR TYPE int2 USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_int2_consistent (internal, int2, int2, oid, internal),
+	FUNCTION	2	gbt_int2_union (bytea, internal),
+	FUNCTION	3	gbt_int2_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_int2_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_int2_picksplit (internal, internal),
+	FUNCTION	7	gbt_int2_same (internal, internal, internal),
+	STORAGE		gbtreekey4;
+
+ALTER OPERATOR FAMILY gist_int2_ops USING gist ADD
+	OPERATOR	6	<> (int2, int2) ,
+	OPERATOR	15	<-> (int2, int2) FOR ORDER BY pg_catalog.integer_ops ,
+	FUNCTION	8 (int2, int2) gbt_int2_distance (internal, int2, int2, oid) ,
+	FUNCTION	9 (int2, int2) gbt_int2_fetch (internal) ;
+
+--
+--
+--
+-- int4 ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_int4_consistent(internal,int4,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int4_distance(internal,int4,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int4_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int4_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int4_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int4_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int4_union(bytea, internal)
+RETURNS gbtreekey8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int4_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_int4_ops
+DEFAULT FOR TYPE int4 USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_int4_consistent (internal, int4, int2, oid, internal),
+	FUNCTION	2	gbt_int4_union (bytea, internal),
+	FUNCTION	3	gbt_int4_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_int4_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_int4_picksplit (internal, internal),
+	FUNCTION	7	gbt_int4_same (internal, internal, internal),
+	STORAGE		gbtreekey8;
+
+ALTER OPERATOR FAMILY gist_int4_ops USING gist ADD
+	OPERATOR	6	<> (int4, int4) ,
+	OPERATOR	15	<-> (int4, int4) FOR ORDER BY pg_catalog.integer_ops ,
+	FUNCTION	8 (int4, int4) gbt_int4_distance (internal, int4, int2, oid) ,
+	FUNCTION	9 (int4, int4) gbt_int4_fetch (internal) ;
+
+
+--
+--
+--
+-- int8 ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_int8_consistent(internal,int8,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int8_distance(internal,int8,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int8_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int8_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int8_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int8_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int8_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_int8_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_int8_ops
+DEFAULT FOR TYPE int8 USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_int8_consistent (internal, int8, int2, oid, internal),
+	FUNCTION	2	gbt_int8_union (bytea, internal),
+	FUNCTION	3	gbt_int8_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_int8_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_int8_picksplit (internal, internal),
+	FUNCTION	7	gbt_int8_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_int8_ops USING gist ADD
+	OPERATOR	6	<> (int8, int8) ,
+	OPERATOR	15	<-> (int8, int8) FOR ORDER BY pg_catalog.integer_ops ,
+	FUNCTION	8 (int8, int8) gbt_int8_distance (internal, int8, int2, oid) ,
+	FUNCTION	9 (int8, int8) gbt_int8_fetch (internal) ;
+
+--
+--
+--
+-- float4 ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_float4_consistent(internal,float4,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float4_distance(internal,float4,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float4_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float4_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float4_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float4_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float4_union(bytea, internal)
+RETURNS gbtreekey8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float4_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_float4_ops
+DEFAULT FOR TYPE float4 USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_float4_consistent (internal, float4, int2, oid, internal),
+	FUNCTION	2	gbt_float4_union (bytea, internal),
+	FUNCTION	3	gbt_float4_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_float4_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_float4_picksplit (internal, internal),
+	FUNCTION	7	gbt_float4_same (internal, internal, internal),
+	STORAGE		gbtreekey8;
+
+ALTER OPERATOR FAMILY gist_float4_ops USING gist ADD
+	OPERATOR	6	<> (float4, float4) ,
+	OPERATOR	15	<-> (float4, float4) FOR ORDER BY pg_catalog.float_ops ,
+	FUNCTION	8 (float4, float4) gbt_float4_distance (internal, float4, int2, oid) ,
+	FUNCTION	9 (float4, float4) gbt_float4_fetch (internal) ;
+
+--
+--
+--
+-- float8 ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_float8_consistent(internal,float8,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float8_distance(internal,float8,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float8_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float8_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float8_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float8_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float8_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_float8_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_float8_ops
+DEFAULT FOR TYPE float8 USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_float8_consistent (internal, float8, int2, oid, internal),
+	FUNCTION	2	gbt_float8_union (bytea, internal),
+	FUNCTION	3	gbt_float8_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_float8_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_float8_picksplit (internal, internal),
+	FUNCTION	7	gbt_float8_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_float8_ops USING gist ADD
+	OPERATOR	6	<> (float8, float8) ,
+	OPERATOR	15	<-> (float8, float8) FOR ORDER BY pg_catalog.float_ops ,
+	FUNCTION	8 (float8, float8) gbt_float8_distance (internal, float8, int2, oid) ,
+	FUNCTION	9 (float8, float8) gbt_float8_fetch (internal) ;
+
+--
+--
+--
+-- timestamp ops
+--
+--
+--
+
+CREATE FUNCTION gbt_ts_consistent(internal,timestamp,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_ts_distance(internal,timestamp,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_tstz_distance(internal,timestamptz,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_ts_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_tstz_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_ts_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_ts_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_ts_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_ts_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_ts_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_timestamp_ops
+DEFAULT FOR TYPE timestamp USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_ts_consistent (internal, timestamp, int2, oid, internal),
+	FUNCTION	2	gbt_ts_union (bytea, internal),
+	FUNCTION	3	gbt_ts_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_ts_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_ts_picksplit (internal, internal),
+	FUNCTION	7	gbt_ts_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_timestamp_ops USING gist ADD
+	OPERATOR	6	<> (timestamp, timestamp) ,
+	OPERATOR	15	<-> (timestamp, timestamp) FOR ORDER BY pg_catalog.interval_ops ,
+	FUNCTION	8 (timestamp, timestamp) gbt_ts_distance (internal, timestamp, int2, oid) ,
+	FUNCTION	9 (timestamp, timestamp) gbt_ts_fetch (internal) ;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_timestamptz_ops
+DEFAULT FOR TYPE timestamptz USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_tstz_consistent (internal, timestamptz, int2, oid, internal),
+	FUNCTION	2	gbt_ts_union (bytea, internal),
+	FUNCTION	3	gbt_tstz_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_ts_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_ts_picksplit (internal, internal),
+	FUNCTION	7	gbt_ts_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_timestamptz_ops USING gist ADD
+	OPERATOR	6	<> (timestamptz, timestamptz) ,
+	OPERATOR	15	<-> (timestamptz, timestamptz) FOR ORDER BY pg_catalog.interval_ops ,
+	FUNCTION	8 (timestamptz, timestamptz) gbt_tstz_distance (internal, timestamptz, int2, oid) ,
+	FUNCTION	9 (timestamptz, timestamptz) gbt_ts_fetch (internal) ;
+
+--
+--
+--
+-- time ops
+--
+--
+--
+
+CREATE FUNCTION gbt_time_consistent(internal,time,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_time_distance(internal,time,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_timetz_consistent(internal,timetz,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_time_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_timetz_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_time_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_time_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_time_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_time_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_time_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_time_ops
+DEFAULT FOR TYPE time USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_time_consistent (internal, time, int2, oid, internal),
+	FUNCTION	2	gbt_time_union (bytea, internal),
+	FUNCTION	3	gbt_time_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_time_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_time_picksplit (internal, internal),
+	FUNCTION	7	gbt_time_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_time_ops USING gist ADD
+	OPERATOR	6	<> (time, time) ,
+	OPERATOR	15	<-> (time, time) FOR ORDER BY pg_catalog.interval_ops ,
+	FUNCTION	8 (time, time) gbt_time_distance (internal, time, int2, oid) ,
+	FUNCTION	9 (time, time) gbt_time_fetch (internal) ;
+
+
+CREATE OPERATOR CLASS gist_timetz_ops
+DEFAULT FOR TYPE timetz USING gist
+AS
+	OPERATOR	1	<   ,
+	OPERATOR	2	<=  ,
+	OPERATOR	3	=   ,
+	OPERATOR	4	>=  ,
+	OPERATOR	5	>   ,
+	FUNCTION	1	gbt_timetz_consistent (internal, timetz, int2, oid, internal),
+	FUNCTION	2	gbt_time_union (bytea, internal),
+	FUNCTION	3	gbt_timetz_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_time_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_time_picksplit (internal, internal),
+	FUNCTION	7	gbt_time_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_timetz_ops USING gist ADD
+	OPERATOR	6	<> (timetz, timetz) ;
+	-- no 'fetch' function, as the compress function is lossy.
+
+
+--
+--
+--
+-- date ops
+--
+--
+--
+
+CREATE FUNCTION gbt_date_consistent(internal,date,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_date_distance(internal,date,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_date_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_date_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_date_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_date_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_date_union(bytea, internal)
+RETURNS gbtreekey8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_date_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_date_ops
+DEFAULT FOR TYPE date USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_date_consistent (internal, date, int2, oid, internal),
+	FUNCTION	2	gbt_date_union (bytea, internal),
+	FUNCTION	3	gbt_date_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_date_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_date_picksplit (internal, internal),
+	FUNCTION	7	gbt_date_same (internal, internal, internal),
+	STORAGE		gbtreekey8;
+
+ALTER OPERATOR FAMILY gist_date_ops USING gist ADD
+	OPERATOR	6	<> (date, date) ,
+	OPERATOR	15	<-> (date, date) FOR ORDER BY pg_catalog.integer_ops ,
+	FUNCTION	8 (date, date) gbt_date_distance (internal, date, int2, oid) ,
+	FUNCTION	9 (date, date) gbt_date_fetch (internal) ;
+
+
+--
+--
+--
+-- interval ops
+--
+--
+--
+
+CREATE FUNCTION gbt_intv_consistent(internal,interval,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_distance(internal,interval,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_decompress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_union(bytea, internal)
+RETURNS gbtreekey32
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_intv_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_interval_ops
+DEFAULT FOR TYPE interval USING gist
+AS
+	OPERATOR	1	< ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	= ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	> ,
+	FUNCTION	1	gbt_intv_consistent (internal, interval, int2, oid, internal),
+	FUNCTION	2	gbt_intv_union (bytea, internal),
+	FUNCTION	3	gbt_intv_compress (internal),
+	FUNCTION	4	gbt_intv_decompress (internal),
+	FUNCTION	5	gbt_intv_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_intv_picksplit (internal, internal),
+	FUNCTION	7	gbt_intv_same (internal, internal, internal),
+	STORAGE		gbtreekey32;
+
+ALTER OPERATOR FAMILY gist_interval_ops USING gist ADD
+	OPERATOR	6	<> (interval, interval) ,
+	OPERATOR	15	<-> (interval, interval) FOR ORDER BY pg_catalog.interval_ops ,
+	FUNCTION	8 (interval, interval) gbt_intv_distance (internal, interval, int2, oid) ,
+	FUNCTION	9 (interval, interval) gbt_intv_fetch (internal) ;
+
+
+--
+--
+--
+-- cash ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_cash_consistent(internal,money,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_cash_distance(internal,money,int2,oid)
+RETURNS float8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_cash_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_cash_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_cash_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_cash_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_cash_union(bytea, internal)
+RETURNS gbtreekey8
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_cash_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_cash_ops
+DEFAULT FOR TYPE money USING gist
+AS
+	OPERATOR	1	< ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	= ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	> ,
+	FUNCTION	1	gbt_cash_consistent (internal, money, int2, oid, internal),
+	FUNCTION	2	gbt_cash_union (bytea, internal),
+	FUNCTION	3	gbt_cash_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_cash_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_cash_picksplit (internal, internal),
+	FUNCTION	7	gbt_cash_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_cash_ops USING gist ADD
+	OPERATOR	6	<> (money, money) ,
+	OPERATOR	15	<-> (money, money) FOR ORDER BY pg_catalog.money_ops ,
+	FUNCTION	8 (money, money) gbt_cash_distance (internal, money, int2, oid) ,
+	FUNCTION	9 (money, money) gbt_cash_fetch (internal) ;
+
+
+--
+--
+--
+-- macaddr ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_macad_consistent(internal,macaddr,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_macad_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_macad_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_macad_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_macad_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_macad_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_macad_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_macaddr_ops
+DEFAULT FOR TYPE macaddr USING gist
+AS
+	OPERATOR	1	< ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	= ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	> ,
+	FUNCTION	1	gbt_macad_consistent (internal, macaddr, int2, oid, internal),
+	FUNCTION	2	gbt_macad_union (bytea, internal),
+	FUNCTION	3	gbt_macad_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_macad_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_macad_picksplit (internal, internal),
+	FUNCTION	7	gbt_macad_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_macaddr_ops USING gist ADD
+	OPERATOR	6	<> (macaddr, macaddr) ,
+	FUNCTION	9 (macaddr, macaddr) gbt_macad_fetch (internal);
+
+
+--
+--
+--
+-- text/ bpchar ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_text_consistent(internal,text,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_text_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bpchar_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_text_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_text_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_text_union(bytea, internal)
+RETURNS gbtreekey_var
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_text_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_text_ops
+DEFAULT FOR TYPE text USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_text_consistent (internal, text, int2, oid, internal),
+	FUNCTION	2	gbt_text_union (bytea, internal),
+	FUNCTION	3	gbt_text_compress (internal),
+	FUNCTION	4	gbt_var_decompress (internal),
+	FUNCTION	5	gbt_text_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_text_picksplit (internal, internal),
+	FUNCTION	7	gbt_text_same (internal, internal, internal),
+	STORAGE			gbtreekey_var;
+
+ALTER OPERATOR FAMILY gist_text_ops USING gist ADD
+	OPERATOR	6	<> (text, text) ,
+	FUNCTION	9 (text, text) gbt_var_fetch (internal) ;
+
+
+---- Create the operator class
+CREATE OPERATOR CLASS gist_bpchar_ops
+DEFAULT FOR TYPE bpchar USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_bpchar_consistent (internal, bpchar , int2, oid, internal),
+	FUNCTION	2	gbt_text_union (bytea, internal),
+	FUNCTION	3	gbt_bpchar_compress (internal),
+	FUNCTION	4	gbt_var_decompress (internal),
+	FUNCTION	5	gbt_text_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_text_picksplit (internal, internal),
+	FUNCTION	7	gbt_text_same (internal, internal, internal),
+	STORAGE			gbtreekey_var;
+
+ALTER OPERATOR FAMILY gist_bpchar_ops USING gist ADD
+	OPERATOR	6	<> (bpchar, bpchar) ,
+	FUNCTION	9 (bpchar, bpchar) gbt_var_fetch (internal) ;
+
+--
+--
+-- bytea ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_bytea_consistent(internal,bytea,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bytea_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bytea_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bytea_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bytea_union(bytea, internal)
+RETURNS gbtreekey_var
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bytea_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_bytea_ops
+DEFAULT FOR TYPE bytea USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_bytea_consistent (internal, bytea, int2, oid, internal),
+	FUNCTION	2	gbt_bytea_union (bytea, internal),
+	FUNCTION	3	gbt_bytea_compress (internal),
+	FUNCTION	4	gbt_var_decompress (internal),
+	FUNCTION	5	gbt_bytea_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_bytea_picksplit (internal, internal),
+	FUNCTION	7	gbt_bytea_same (internal, internal, internal),
+	STORAGE			gbtreekey_var;
+
+ALTER OPERATOR FAMILY gist_bytea_ops USING gist ADD
+	OPERATOR	6	<> (bytea, bytea) ,
+	FUNCTION	9 (bytea, bytea) gbt_var_fetch (internal) ;
+
+
+--
+--
+--
+-- numeric ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_numeric_consistent(internal,numeric,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_numeric_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_numeric_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_numeric_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_numeric_union(bytea, internal)
+RETURNS gbtreekey_var
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_numeric_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_numeric_ops
+DEFAULT FOR TYPE numeric USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_numeric_consistent (internal, numeric, int2, oid, internal),
+	FUNCTION	2	gbt_numeric_union (bytea, internal),
+	FUNCTION	3	gbt_numeric_compress (internal),
+	FUNCTION	4	gbt_var_decompress (internal),
+	FUNCTION	5	gbt_numeric_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_numeric_picksplit (internal, internal),
+	FUNCTION	7	gbt_numeric_same (internal, internal, internal),
+	STORAGE			gbtreekey_var;
+
+ALTER OPERATOR FAMILY gist_numeric_ops USING gist ADD
+	OPERATOR	6	<> (numeric, numeric) ,
+	FUNCTION	9 (numeric, numeric) gbt_var_fetch (internal) ;
+
+
+--
+--
+-- bit ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_bit_consistent(internal,bit,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bit_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bit_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bit_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bit_union(bytea, internal)
+RETURNS gbtreekey_var
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_bit_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_bit_ops
+DEFAULT FOR TYPE bit USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_bit_consistent (internal, bit, int2, oid, internal),
+	FUNCTION	2	gbt_bit_union (bytea, internal),
+	FUNCTION	3	gbt_bit_compress (internal),
+	FUNCTION	4	gbt_var_decompress (internal),
+	FUNCTION	5	gbt_bit_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_bit_picksplit (internal, internal),
+	FUNCTION	7	gbt_bit_same (internal, internal, internal),
+	STORAGE			gbtreekey_var;
+
+ALTER OPERATOR FAMILY gist_bit_ops USING gist ADD
+	OPERATOR	6	<> (bit, bit) ,
+	FUNCTION	9 (bit, bit) gbt_var_fetch (internal) ;
+
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_vbit_ops
+DEFAULT FOR TYPE varbit USING gist
+AS
+	OPERATOR	1	<  ,
+	OPERATOR	2	<= ,
+	OPERATOR	3	=  ,
+	OPERATOR	4	>= ,
+	OPERATOR	5	>  ,
+	FUNCTION	1	gbt_bit_consistent (internal, bit, int2, oid, internal),
+	FUNCTION	2	gbt_bit_union (bytea, internal),
+	FUNCTION	3	gbt_bit_compress (internal),
+	FUNCTION	4	gbt_var_decompress (internal),
+	FUNCTION	5	gbt_bit_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_bit_picksplit (internal, internal),
+	FUNCTION	7	gbt_bit_same (internal, internal, internal),
+	STORAGE			gbtreekey_var;
+
+ALTER OPERATOR FAMILY gist_vbit_ops USING gist ADD
+	OPERATOR	6	<> (varbit, varbit) ,
+	FUNCTION	9 (varbit, varbit) gbt_var_fetch (internal) ;
+
+
+--
+--
+--
+-- inet/cidr ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_inet_consistent(internal,inet,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_inet_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_inet_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_inet_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_inet_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_inet_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_inet_ops
+DEFAULT FOR TYPE inet USING gist
+AS
+	OPERATOR	1	<   ,
+	OPERATOR	2	<=  ,
+	OPERATOR	3	=   ,
+	OPERATOR	4	>=  ,
+	OPERATOR	5	>   ,
+	FUNCTION	1	gbt_inet_consistent (internal, inet, int2, oid, internal),
+	FUNCTION	2	gbt_inet_union (bytea, internal),
+	FUNCTION	3	gbt_inet_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_inet_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_inet_picksplit (internal, internal),
+	FUNCTION	7	gbt_inet_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_inet_ops USING gist ADD
+	OPERATOR	6	<>  (inet, inet) ;
+	-- no fetch support, the compress function is lossy
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_cidr_ops
+DEFAULT FOR TYPE cidr USING gist
+AS
+	OPERATOR	1	<  (inet, inet)  ,
+	OPERATOR	2	<= (inet, inet)  ,
+	OPERATOR	3	=  (inet, inet)  ,
+	OPERATOR	4	>= (inet, inet)  ,
+	OPERATOR	5	>  (inet, inet)  ,
+	FUNCTION	1	gbt_inet_consistent (internal, inet, int2, oid, internal),
+	FUNCTION	2	gbt_inet_union (bytea, internal),
+	FUNCTION	3	gbt_inet_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_inet_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_inet_picksplit (internal, internal),
+	FUNCTION	7	gbt_inet_same (internal, internal, internal),
+	STORAGE		gbtreekey16;
+
+ALTER OPERATOR FAMILY gist_cidr_ops USING gist ADD
+	OPERATOR	6	<> (inet, inet) ;
+	-- no fetch support, the compress function is lossy
+
+
+--
+--
+--
+-- uuid ops
+--
+--
+--
+-- define the GiST support methods
+CREATE FUNCTION gbt_uuid_consistent(internal,uuid,int2,oid,internal)
+RETURNS bool
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_fetch(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_compress(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_penalty(internal,internal,internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_picksplit(internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_union(bytea, internal)
+RETURNS gbtreekey16
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+CREATE FUNCTION gbt_uuid_same(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C IMMUTABLE STRICT;
+
+-- Create the operator class
+CREATE OPERATOR CLASS gist_uuid_ops
+DEFAULT FOR TYPE uuid USING gist
+AS
+	OPERATOR	1	<   ,
+	OPERATOR	2	<=  ,
+	OPERATOR	3	=   ,
+	OPERATOR	4	>=  ,
+	OPERATOR	5	>   ,
+	FUNCTION	1	gbt_uuid_consistent (internal, uuid, int2, oid, internal),
+	FUNCTION	2	gbt_uuid_union (bytea, internal),
+	FUNCTION	3	gbt_uuid_compress (internal),
+	FUNCTION	4	gbt_decompress (internal),
+	FUNCTION	5	gbt_uuid_penalty (internal, internal, internal),
+	FUNCTION	6	gbt_uuid_picksplit (internal, internal),
+	FUNCTION	7	gbt_uuid_same (internal, internal, internal),
+	STORAGE		gbtreekey32;
+
+ALTER OPERATOR FAMILY gist_uuid_ops USING gist ADD
+	OPERATOR	6	<>  (uuid, uuid) ,
+	FUNCTION	9 (uuid, uuid) gbt_uuid_fetch (internal) ;
diff --git a/contrib/btree_gist/btree_gist.control b/contrib/btree_gist/btree_gist.control
index c7adfeb..74d0e92 100644
--- a/contrib/btree_gist/btree_gist.control
+++ b/contrib/btree_gist/btree_gist.control
@@ -1,5 +1,5 @@
 # btree_gist extension
 comment = 'support for indexing common datatypes in GiST'
-default_version = '1.1'
+default_version = '1.2'
 module_pathname = '$libdir/btree_gist'
 relocatable = true
diff --git a/contrib/btree_gist/btree_gist.h b/contrib/btree_gist/btree_gist.h
index dcffbb5..bdf54d7 100644
--- a/contrib/btree_gist/btree_gist.h
+++ b/contrib/btree_gist/btree_gist.h
@@ -31,7 +31,8 @@ enum gbtree_type
 	gbt_t_bpchar,
 	gbt_t_bytea,
 	gbt_t_bit,
-	gbt_t_inet
+	gbt_t_inet,
+	gbt_t_uuid
 };
 
 
diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c
new file mode 100644
index 0000000..559b1c9
--- /dev/null
+++ b/contrib/btree_gist/btree_uuid.c
@@ -0,0 +1,280 @@
+/*
+ * contrib/btree_gist/btree_uuid.c
+ */
+#include "postgres.h"
+
+#include "math.h"
+#include "btree_gist.h"
+#include "btree_utils_num.h"
+#include "utils/uuid.h"
+#include "utils/builtins.h"
+#include "port/pg_bswap.h"
+
+/*
+ * Also defined in backend/utils/adt/uuid.c
+ * We define also two uint64 fields, that will be used for uuid comparisons.
+ */
+union pg_uuid_t
+{
+	unsigned char data[UUID_LEN];
+	uint64 v64[2];
+};
+
+typedef struct
+{
+	pg_uuid_t	lower,
+				upper;
+} uuidKEY;
+
+
+/*
+** UUID ops
+*/
+PG_FUNCTION_INFO_V1(gbt_uuid_compress);
+PG_FUNCTION_INFO_V1(gbt_uuid_fetch);
+PG_FUNCTION_INFO_V1(gbt_uuid_union);
+PG_FUNCTION_INFO_V1(gbt_uuid_picksplit);
+PG_FUNCTION_INFO_V1(gbt_uuid_consistent);
+PG_FUNCTION_INFO_V1(gbt_uuid_penalty);
+PG_FUNCTION_INFO_V1(gbt_uuid_same);
+
+
+/*
+ * Convert uuid value to other uuid value, that will have correct low and high
+ * parts of uuid. Because the uuid type by default has a bigendian order, so
+ * for correct uint64 values we need to change ordering on littleendian
+ * machines, and that's the reason we can't change fields in place (because it
+ * can corrupt uuid).
+ *
+ * Reason to use uint64 values is that comparison using them is faster than
+ * memcmp and same time it has a same behavior.
+ */
+static void
+uuid_cnv(pg_uuid_t *src, pg_uuid_t *dst)
+{
+#ifdef WORDS_BIGENDIAN
+	memcpy(dst->data, src->data, UUID_LEN);
+#else
+	dst->v64[0] = BSWAP64(src->v64[0]);
+	dst->v64[1] = BSWAP64(src->v64[1]);
+#endif
+}
+
+static int
+uuid_cmp_parts(pg_uuid_t *a, pg_uuid_t *b)
+{
+	pg_uuid_t ua, ub;
+
+	uuid_cnv(a, &ua);
+	uuid_cnv(b, &ub);
+
+	if (ua.v64[0] == ub.v64[0])
+	{
+		if (ua.v64[1] == ub.v64[1])
+			return 0;
+
+		return (ua.v64[1] > ub.v64[1]) ? 1 : -1;
+	}
+
+	return (ua.v64[0] > ub.v64[0]) ? 1 : -1;
+}
+
+static bool
+gbt_uuidgt(const void *a, const void *b)
+{
+	return uuid_cmp_parts((pg_uuid_t *) a, (pg_uuid_t *) b) > 0;
+}
+
+static bool
+gbt_uuidge(const void *a, const void *b)
+{
+	return uuid_cmp_parts((pg_uuid_t *) a, (pg_uuid_t *) b) >= 0;
+}
+
+static bool
+gbt_uuideq(const void *a, const void *b)
+{
+	return uuid_cmp_parts((pg_uuid_t *) a, (pg_uuid_t *) b) == 0;
+}
+
+static bool
+gbt_uuidle(const void *a, const void *b)
+{
+	return uuid_cmp_parts((pg_uuid_t *) a, (pg_uuid_t *) b) <= 0;
+}
+
+static bool
+gbt_uuidlt(const void *a, const void *b)
+{
+	return uuid_cmp_parts((pg_uuid_t *) a, (pg_uuid_t *) b) < 0;
+}
+
+static int
+gbt_uuidkey_cmp(const void *a, const void *b)
+{
+	uuidKEY    *ia = (uuidKEY *) (((const Nsrt *) a)->t);
+	uuidKEY    *ib = (uuidKEY *) (((const Nsrt *) b)->t);
+	int			res;
+
+	res = uuid_cmp_parts(&ia->upper, &ib->upper);
+	if (res == 0)
+		return uuid_cmp_parts(&ia->lower, &ib->lower);
+
+	return res;
+}
+
+
+static const gbtree_ninfo tinfo =
+{
+	gbt_t_uuid,
+	UUID_LEN,
+	32,							/* sizeof(gbtreekey32) */
+	gbt_uuidgt,
+	gbt_uuidge,
+	gbt_uuideq,
+	gbt_uuidle,
+	gbt_uuidlt,
+	gbt_uuidkey_cmp,
+	NULL
+};
+
+
+/**************************************************
+ * uuid ops
+ **************************************************/
+
+
+Datum
+gbt_uuid_compress(PG_FUNCTION_ARGS)
+{
+	GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
+	GISTENTRY  *retval;
+
+	if (entry->leafkey)
+	{
+		char	   *r = (char *) palloc(2 * UUID_LEN);
+		pg_uuid_t   *key = DatumGetUUIDP(entry->key);
+
+		retval = palloc(sizeof(GISTENTRY));
+
+		memcpy((void *) r, (void *) key, UUID_LEN);
+		memcpy((void *) (r + UUID_LEN), (void *) key, UUID_LEN);
+		gistentryinit(*retval, PointerGetDatum(r),
+					  entry->rel, entry->page,
+					  entry->offset, FALSE);
+	} else {
+		retval = entry;
+	}
+
+	PG_RETURN_POINTER(retval);
+}
+
+Datum
+gbt_uuid_fetch(PG_FUNCTION_ARGS)
+{
+	GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
+
+	PG_RETURN_POINTER(gbt_num_fetch(entry, &tinfo));
+}
+
+Datum
+gbt_uuid_consistent(PG_FUNCTION_ARGS)
+{
+	GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
+	pg_uuid_t   *query = PG_GETARG_UUID_P(1);
+	StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+	/* Oid		subtype = PG_GETARG_OID(3); */
+	bool	   *recheck = (bool *) PG_GETARG_POINTER(4);
+	uuidKEY    *kkk = (uuidKEY *) DatumGetPointer(entry->key);
+	GBT_NUMKEY_R key;
+
+	/* All cases served by this function are exact */
+	*recheck = false;
+
+	key.lower = (GBT_NUMKEY *) &kkk->lower;
+	key.upper = (GBT_NUMKEY *) &kkk->upper;
+
+	PG_RETURN_BOOL(
+		gbt_num_consistent(&key, (void *) query, &strategy,
+			GIST_LEAF(entry), &tinfo)
+	);
+}
+
+Datum
+gbt_uuid_union(PG_FUNCTION_ARGS)
+{
+	GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
+	void	   *out = palloc(sizeof(uuidKEY));
+
+	*(int *) PG_GETARG_POINTER(1) = sizeof(uuidKEY);
+	PG_RETURN_POINTER(gbt_num_union((void *) out, entryvec, &tinfo));
+}
+
+/*
+ * Calculate a distance. Distance is calculated by subtraction of two
+ * uuid values presented as 128bit numbers, and by converting the result
+ * to float (requirement of GiST).
+ */
+static float
+uuid_parts_distance(pg_uuid_t *a, pg_uuid_t *b)
+{
+	pg_uuid_t ua, ub;
+	const double mp = pow(2, -64);
+
+	uuid_cnv(a, &ua);
+	uuid_cnv(b, &ub);
+
+	Assert(ua.v64[0] > ub.v64[0]);
+	uint64 high = ua.v64[0] - ub.v64[0];
+	uint64 low = ua.v64[1] - ub.v64[1];
+	if (low > ua.v64[1])
+		high--;
+
+	return (float) (ldexp(high, 64) + (double) low * mp);
+}
+
+Datum
+gbt_uuid_penalty(PG_FUNCTION_ARGS)
+{
+	uuidKEY    *origentry = (uuidKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);
+	uuidKEY    *newentry = (uuidKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(1))->key);
+	float	   *result = (float *) PG_GETARG_POINTER(2);
+
+	int cmp = uuid_cmp_parts(&newentry->lower, &origentry->upper);
+	if (cmp == 0)
+		*result = 0.0F;
+	else if (cmp > 0)
+		*result = uuid_parts_distance(&newentry->lower, &origentry->upper);
+	else
+	{
+		int cmp = uuid_cmp_parts(&newentry->lower, &origentry->lower);
+		if (cmp == 0)
+			*result = 0.0F;
+		else if (cmp < 0)
+			*result = uuid_parts_distance(&origentry->lower, &newentry->lower);
+	}
+
+	PG_RETURN_POINTER(result);
+}
+
+Datum
+gbt_uuid_picksplit(PG_FUNCTION_ARGS)
+{
+	PG_RETURN_POINTER(gbt_num_picksplit(
+									(GistEntryVector *) PG_GETARG_POINTER(0),
+									  (GIST_SPLITVEC *) PG_GETARG_POINTER(1),
+										&tinfo
+										));
+}
+
+Datum
+gbt_uuid_same(PG_FUNCTION_ARGS)
+{
+	uuidKEY    *b1 = (uuidKEY *) PG_GETARG_POINTER(0);
+	uuidKEY    *b2 = (uuidKEY *) PG_GETARG_POINTER(1);
+	bool	   *result = (bool *) PG_GETARG_POINTER(2);
+
+	*result = gbt_num_same((void *) b1, (void *) b2, &tinfo);
+	PG_RETURN_POINTER(result);
+}
diff --git a/contrib/btree_gist/data/uuid.data b/contrib/btree_gist/data/uuid.data
new file mode 100644
index 0000000..df118d3
--- /dev/null
+++ b/contrib/btree_gist/data/uuid.data
@@ -0,0 +1,703 @@
+5ad32d7e-b463-4363-a65f-52475d9fab27
+7787b66e-cf0e-48c2-b989-1e44e8a00891
+75ec8a55-afcf-442d-9e1d-f9d67a15caf9
+6f36f2e9-5e58-4961-9e8d-9c3ca1cfcd44
+78f6d184-f74e-4a38-81ce-a821e301e9ac
+1aa4bf49-dd76-40df-a86c-393fd202b710
+98559f1d-00b3-417e-bc57-9053545a260d
+ac24b4d7-1a8f-4abc-a02e-b3294497d18e
+a425d99f-ee91-419a-8cd1-6908b8c89679
+815f3632-4d1b-42e3-8dbf-68a20e7fbea5
+ae212041-e64a-4ff1-b8c9-b922fc3f2087
+8e580963-0584-4391-9f1e-3e607d435bd8
+9348cf2f-fe8b-4f05-829e-e2f732482bcc
+807b3ff5-0dac-46e1-ba10-07753ec4c7f5
+93325505-83f0-41f4-a060-0d6e1a166815
+cabeaad4-0096-4bc8-8d29-29623d3658c9
+8edda4dd-07fc-4457-b9c0-a28a97cdf9ee
+4b7b09ae-d11d-4d54-aad2-c7dcbce92e04
+3ba8ace3-be63-4a11-b057-8ede07d49089
+70dfc341-127f-4d54-a8d4-8159eb119a8f
+\N
+f4910786-02d1-4874-9be7-c2cd5774fa1e
+61a8407e-91f4-41f4-8050-32c8659839ac
+d23c6778-d021-426b-8435-e7ee7172a456
+\N
+77b3bb98-f8a6-4dc1-b2db-174da47ef88d
+4ed9962e-9f7b-4bd2-b791-62c87e7e0f32
+\N
+bf30fce0-2497-4594-94e2-5dabb58fa3d6
+289dcd8c-8046-4748-b1e7-3afc51e3791b
+622aa432-d5e9-4d02-8a3f-09813dcc00cf
+f95c69c4-7d22-41c2-89c1-6bcc6835d478
+2b4ed1c1-38e2-495c-8fba-f2060b983f8a
+05905429-70b8-408b-a9b1-b8f00522ec7a
+8b1dcbd2-10ca-4a37-a080-a1c846519370
+a6225a20-25c9-4afe-bc33-e6f600eb57a3
+b0121e3f-157c-4c8f-acf3-78dfc752bcb5
+\N
+\N
+11f510fb-ae06-4542-b936-cb5713908e10
+\N
+26293032-dbd0-4914-be29-c060c5adf98b
+d3d0b0ce-b60c-4864-9557-ba4a9cca8b1f
+16c70611-bbfd-4a46-95fd-3c9e12ff4641
+27dc15a1-5518-4310-bb31-52da9f148afc
+a86c2830-282a-4a74-8b5a-e5b562325d82
+8afadc39-3a85-490e-a31e-18d5e787a639
+1159af7d-4d72-4651-a013-9de9f3f03002
+5835b0b1-6a50-44c2-ab41-81fa34a29411
+\N
+e031ab87-ccb2-496c-9eba-9966415f82d7
+\N
+67b1194b-b700-440e-aa35-93f118707632
+a9a88b6a-c2f0-4de6-ab99-b34853aae425
+c9e3aeda-2001-4ab9-aaf1-57b33d841960
+6bbc3fae-1495-4178-8445-04960dd97c56
+bd7e52f5-4362-4447-9f7c-da14ed54266b
+145fd346-4057-4e91-aa82-594d7a16ebce
+\N
+029d9c72-77e1-4951-b185-30574d00862d
+d9233d92-3491-4985-a6bb-763f177535a5
+abe1ffca-8325-4041-8acd-b08904f76cb0
+0c8afca8-f720-4c4b-aab4-e061011db5ca
+4f636f73-71e8-4b14-b4c5-25233d115421
+f05a62f1-f495-4ea1-9e20-433c67d2c94e
+a21ee4b2-e9bd-4510-9b74-0bac543fc378
+a41bf7a6-92c2-48f1-80ef-0c3d4e002b5f
+ed6b5777-b1b4-4e85-ab12-ce1f8054ced1
+04b9cc30-6d01-4f5d-9254-81eb78fbb4af
+a89561d0-88e2-43d0-9548-35be00b1f028
+c77ad187-1ed9-4b25-a474-35bf8481cf25
+cc4cf4a1-aa64-4916-ae50-5fa7bb5c3b3b
+\N
+70337711-dd30-4454-bd6c-0e8f77ba34a0
+1ed02b49-aace-4c5b-a1cf-bc20e2edf03c
+84b0f797-baa6-448f-ba29-0234e64ac30b
+40556603-648c-4359-9c4c-5e76f21efd1f
+af21ec76-27d6-47d8-9ede-1b08049410d3
+0f889e8a-e3b5-46bb-b222-e91cf32623ff
+3f5403c1-16b1-4a36-bf4b-77333226e8e4
+5c5ebc3f-aced-4036-9b4a-59e19bd9c74c
+8acec555-d518-422b-b416-19a2c5cbf825
+ab1effba-c614-4af2-9c9a-df8f6566f427
+4ae0722c-1c55-4ef1-a9aa-ddd9c43f3dd0
+77e2f0bf-cff2-4128-92da-c6d4bc656267
+2e643fa5-23db-4073-8dac-6f714f823af0
+d6624eac-e776-4e18-9d3c-d6c265a8c378
+\N
+623353ca-0675-4a05-94cf-7bb62e49aece
+2d29a192-0272-49fa-99ea-9b30e81f0b47
+54cf75a7-6ece-4e20-8f24-036f3daa2fa1
+8964987c-bacd-4474-83a7-2ea51ac7ff3a
+87f3e366-6f70-4304-8789-e03f94adcadb
+603c2f61-c91c-4f7b-9de4-ad43ea68b00a
+fd036a77-ee2a-4c33-a985-709d8667c1a2
+be90eb3d-c147-447b-8ff1-2a62aba6ef3c
+448ec399-4249-4daf-85f8-23ad8cc7fbdf
+9788716f-1852-4b37-a2c4-f4f65d4eeef6
+bed0413b-64f7-4cf3-b2bd-765b10a31ba8
+6add9145-07d8-4d1d-bad0-57c2a914b90b
+\N
+caf27337-384f-4f51-92ce-76bd5dbf7317
+0f73ab51-4dc6-4cbf-b74f-faced034c866
+0b8c972d-f1e4-4150-bd9e-baee71af1ca9
+0567dd6d-0386-4002-849b-591d1512cc1e
+4c783517-29df-4efa-8f40-12150943e6ab
+1be634a9-77cc-4e17-8b24-817067dd2235
+ab233cca-286f-4977-ab03-0c9870b17934
+88d77def-4019-4b0d-8de5-47f3b84b4c1f
+036f53a5-5270-4844-bedb-251512538a33
+\N
+\N
+afca4ef6-56ac-4bbe-8c44-f54858b55ab7
+8613d2fe-d9b6-4491-a70d-8de3ad41b4df
+f084c252-43db-4735-bb47-eb45741cedf8
+d35f523d-4c8b-43a7-8839-2c5567ed4934
+40677618-afed-45cd-9299-ff715494d56f
+7a5aa5c4-884f-460f-a9f4-a0033eb82de2
+26007d37-61cc-4386-a85e-08e56de23a2c
+3753e811-da3f-4a23-92ce-1ae502c99195
+2dfb1eb2-56bf-4b0f-b2f8-3ec2dc2b0191
+551d2a52-f84a-42e4-aa2b-84f7000a3926
+\N
+\N
+b9cd6a67-e12b-4a0b-b935-92e267ea776f
+fd4ec635-a1e5-4fcb-89a3-57bf8aa408b8
+6599e40d-a602-4a54-a24b-a694432992a2
+\N
+55e65ca2-4136-4a4b-ba78-02ecb8053cf3
+c5b2bc4d-acf9-4b11-ae9a-02ecb8053cf3
+34bb5f60-3e47-445a-acbd-a5889334f4d5
+743008b5-0779-4d50-8662-1c5988335c33
+71317e40-193f-4a7f-a94a-a188847b0249
+23f14966-adfc-4460-84fa-14190d33d55f
+d1bd4bba-8a17-4e8f-93d9-ed09f4719ea4
+b5964792-f607-4cbe-9759-3e459a90fe5e
+c49c96e9-77ec-4b75-a3d3-00f9fa8c9ac2
+842f694a-426c-45c7-a7a9-5d750adbdacb
+c48446ee-c9f6-4038-9ca2-e32f8706c36f
+fd0ab627-022b-4fa5-bb9d-0ada8088c9e6
+b27dd1a0-7938-4e42-a9e7-93672a7d85a1
+\N
+5ae9add1-28d5-4fd4-bf1d-f5a3ebabc31e
+55e65ca2-4136-4a4b-ba78-cd3fe4678203
+25706dc9-61d1-4c67-be11-22f953132d48
+723f5921-c592-40a8-955c-7f46995b8173
+69c29563-77e3-43e6-93e4-d6ed321a294e
+8d6b7ea4-d062-4fb9-a20a-d718abd9e331
+b1e945bc-2a8e-4d1c-b9e7-322b95d31b86
+4ef84213-0b39-4d86-80bb-14d2376f77cf
+fd3daf86-96e0-42b7-b83a-c2781aa28e4d
+ad6c141d-e257-410b-8596-77153d37b428
+40dd6844-7b56-4f39-a7cb-c00ae3870108
+883559f7-e3af-4f44-aff3-a4bd906e5f86
+98c04f9a-d3b7-4d21-9f89-43ef124d48fa
+\N
+55e65ca2-4136-4a4b-ba78-698a09529f02
+ee145a4b-6016-4914-b947-698a09529f02
+931473e1-2cb2-4951-9ab0-039396dc2ccb
+0df573b5-3ef9-40ef-9b05-208e649965d1
+b13a6d18-33c9-4aa0-b167-88542cd5d8ba
+73cbd742-37db-4497-9a30-e10279e9cb10
+63a68ba8-e223-4db7-b56f-459d25d3f873
+aa2e9b1e-e09c-4848-983e-aa4adf34938b
+2d58bb19-ac14-42fe-b427-59798b8d9fcb
+5d3b3f34-ce9a-4ee6-9400-c7bf7576ffa8
+41945dd7-9fb0-47af-8ee9-10e5a530da3e
+\N
+c3a9b409-4e0c-4426-8a3d-a87236d189bd
+84da10fe-818d-4a3b-85fc-d4c169ca92bc
+12a7071d-902d-4438-9c40-c2cd875b51f7
+2e7e60fb-ba46-4005-b6b5-e3630b699254
+9782a6b8-d676-45a8-8991-1c44e60764cc
+6760f7e2-6b5a-4ce7-a66a-9014068fc8eb
+\N
+\N
+2dab7131-2ba8-4def-9b28-00c0b1ed929a
+9d3df737-16fd-481a-bde6-12a08a01e2f5
+d8390c84-1e90-4759-bd72-2629ca4c51f4
+0c1d5e42-5070-4e51-8076-8e8c15148f99
+9374026b-0ec3-4c44-b656-36520d322eec
+\N
+\N
+ad0aa9a0-122c-4025-b889-70778af8e6e4
+948d0dea-5d30-45da-8867-09d2e1fbedb9
+d295f644-5f4a-4808-b966-b14e73d9fa2a
+2de79a17-f91b-4310-ad74-dfa0729ff94d
+\N
+23eda39b-4f4f-4355-aeba-72771f922d20
+bccc111d-6f15-42c4-95c2-2c3d3329e83c
+c4f864e2-f81a-4b65-bd7f-cac745bd7f32
+10447976-1ef1-4599-85fe-d837074c6ea0
+8eecc1f2-77b2-4058-811c-11efb47eb662
+98ad70bc-39b0-4b33-a104-241c6970c4c3
+15c04e8c-69d9-44b7-a177-d08c5b181045
+c6de918d-6536-47b3-b80f-80d049cfe550
+548321e5-cde7-4d74-9bb3-929244806e13
+7e046db3-d1dc-46b3-81e2-fc867ee83298
+5dd5cc44-4ad1-4658-9b4f-509c35a4976e
+1aecf136-7583-4d31-980f-7fa5c4610e50
+ddb79c27-a80d-483a-9a52-c61ae2f4f93f
+e7aa3080-4d09-43ae-8a2b-5b539ffef909
+aeba0aac-6b8d-4d8e-a5b8-a37359c457c6
+64b5c8e8-118b-414f-9da3-73286249243c
+8b72b6d2-d3bb-4e74-a79f-577ff8767777
+dccd9254-24b4-4269-bf07-cfbbd349df54
+51cb6ab8-06c7-4280-9e0f-b2b9dcf026a3
+1f3d16eb-895f-48dd-a9e2-18eda41dacea
+3ecc08b6-2b67-442c-92ef-b74af4cb4f42
+b55c7f4a-3d05-43b9-846a-23b86a73d202
+4f54dfd8-39fd-4178-bafa-97b34f131552
+d6874b48-96c0-459f-8dd1-7f7dcbc44b22
+93a213c8-6e28-4eb7-8a94-e1b18e8bebd6
+0743014a-e4a0-4eb9-a9ab-23b0d0d96782
+a7ffb6c6-4e3d-4d08-9cbc-297d8b1bc29e
+45e788c4-4054-4d80-886a-e4f006936b7d
+c51c64be-f130-40c1-95b9-adb39ef25385
+3af1d3cb-df6b-4d26-910d-a314a57f8550
+\N
+477c1cd3-e9c9-4252-bc7c-4db57368ffc6
+b49ecde1-7413-4d6e-80c1-5df680d25617
+1f127009-eb85-4e7d-bfb1-1d804d86609b
+\N
+25e6a224-70a3-44dc-8faf-50feecee3480
+79094fc2-36d9-4521-bf36-0f6e0850fb6d
+cb9b1ab9-96e3-4ac5-aa51-8c3c47437893
+c09d4ab8-5f03-496f-ad31-4b9e7348b9da
+d5ab17e1-7017-4fbf-a30e-73a97a85a852
+\N
+8c937920-7219-43fe-8436-97aca339a5e5
+b8d001a3-036c-4f15-846d-32e229d66985
+bf2cae32-9096-4ae4-b0c7-efdafdd16e0d
+d916d001-fc9b-4e05-985c-b172b873c217
+\N
+\N
+e2c40a42-ef79-4754-a089-e254345896c3
+953fb2d0-d53a-4cc9-ad48-547263b85399
+8e2b1b14-1c56-48b9-a2b6-7868b42e6efc
+\N
+\N
+76b7f2cb-00e9-4936-bcd0-ebf1db9c6fec
+e24d88fb-6219-44c7-9f70-d34e0b274cdc
+fda48ed2-113d-4403-b2dc-57f7afe25842
+9aa44ba6-6c48-418d-8689-eab1112b3fbb
+42936d25-09a3-4af5-ab98-8c1216c5eca9
+\N
+a9ddecb1-b762-4cda-a785-cce77c51c67a
+f733a811-b83c-4a29-a59c-786825ea2070
+95e94fe5-eea0-4656-bc34-15724a4785a2
+521c55e4-3a5c-4064-b42f-0e8023af9c94
+a3379a9d-4b32-4956-a814-57b46db4bdc2
+0e46cef6-49ed-4a54-a6be-debcb7546583
+\N
+1b1f4424-5c05-4ee6-8eb6-1deb677c743f
+\N
+caaf024d-ef32-42e5-8875-6fe563e7e18a
+\N
+98e9ce77-8677-44aa-8703-4633dd089225
+66037e2f-634f-4096-8823-9ded5cb533bb
+\N
+f6726b9f-8a0b-498e-8479-3ffa7af0cd62
+\N
+4fd27a3c-2dd1-4f3d-9f48-a50407e9d1a3
+75737e5a-a509-4239-a627-99e430a4c3d1
+6a8bd5d4-7545-4dc8-86c3-003321cfd437
+73e26e64-baa7-4a9b-8833-8bd822c47146
+\N
+d6de86fd-3fae-4de2-9082-e86e53b6ad7c
+1143e251-091a-408f-b7b2-c12d05b42c2c
+4cc745fe-4667-4041-b941-4a3a23f9c727
+ae7b16f4-9ba8-4dc0-aae7-f78258d4993b
+38c5d6b2-ae34-4054-aa07-9a689afb23e1
+3421dcd4-553b-4ba6-b661-5cbf687b982a
+\N
+75ab9d18-5ba5-479c-b3cc-bcf3c41618b8
+c5a768bc-7765-4973-bd8b-a9528279a0a7
+e7b98405-47e6-404d-ab16-bb76fcca2b1d
+\N
+6b764c11-a1f1-4ae2-ab87-88bdf7597cbe
+\N
+e439cb96-6502-4207-a0c8-2fa6bf583bd2
+\N
+0d3089c0-3e26-4425-b48a-3e8f18c8b5a2
+1a625bc4-f83b-4735-bf01-a9f748080fa5
+1d1f382c-c702-4c59-84f1-4b4e2f01d1ca
+8d3b094e-112e-4535-87b3-04272426a956
+616f4879-2a33-4a5f-a776-08462d27ee1b
+e2c83f19-3163-487c-8fc1-7fc00d40ca75
+dbf94f48-5f01-46dd-a13d-def8f9dbb6e0
+8c37b9f1-9766-4a5f-a222-eded294dad76
+\N
+4cb9a4a8-e4bf-4757-9d68-36a3e24d7b6f
+071ba528-c84a-45fc-8ac5-2368e6c640ae
+ad34c9ca-0a4b-4c23-b64c-ccffa1f4dcd8
+4915fbe9-84b6-4bec-b6b4-50ff0cc49e9f
+622ef77b-e22d-4ca2-850b-298abb39d870
+3e1803c7-8109-43f2-a742-b4ae6e56be55
+\N
+0de0b43f-3e59-4060-a43d-baee17dd2c57
+\N
+1a8e57f0-e65b-4e55-b46a-207825e00287
+\N
+\N
+1877c37c-3567-46e6-9afe-222ac3ccf36f
+8f4bab7d-9454-4081-b1af-8e4956ab940f
+c1d23aab-ce09-4afc-a95c-b9b0f7b9c16a
+04761b0d-40ce-4cb2-a7e0-b1f6d582be26
+a29059f5-d4bc-446f-b903-6f09ec57a410
+4f9fcf12-54ff-442e-a7e3-6aabf45fa474
+facf76d4-e82b-44a3-9d7c-50a84395a2dc
+\N
+84484041-8e47-4349-91d6-418e9b584750
+44b949a1-502e-4309-af86-90bdfb04a085
+c5da9f0a-cca7-4b5b-82c2-1108e10989df
+98e487b8-9527-4fcd-a20a-812c909f1342
+e950bf7c-280d-4774-8891-6cf6da8c8ab4
+d5a28af5-f357-4de9-a8e3-3518a8ca5556
+ae450238-e659-4253-90ee-afd66a676515
+294509e2-b4e1-42a3-8982-b7dca385e4c9
+9546a087-6cac-47d6-b55f-3828df9aec99
+4a715abf-18d1-4ffc-9ea3-fd3f069502d9
+e0e07aef-ce8b-4499-befa-430724707d66
+4df8c6d6-278e-4ba4-af45-7240805ce0a0
+1637abb1-1d05-4055-98fa-296fe8f8bbf2
+e3850663-b73e-4f0a-8107-0775825783ef
+7b2dbbbf-2c82-49dd-9383-0edd1aee6d89
+2b99818e-2c53-4ab2-8f78-29bdbaa208b2
+22787985-d2c1-4af4-8b90-7bc441123952
+153166fb-923e-41d4-8413-edad8959a8d5
+732fab66-3055-49f8-807e-463fae914988
+1c39ccc7-2b24-4760-93d3-3e687ed04e1c
+33f3d119-ff2a-4341-8145-b69f67e11192
+0370cd89-a0c1-4d8c-85fe-3df1eddc734b
+d5a5e95c-e99c-48f6-9ebb-765651b893f9
+3e73a023-7b53-4323-a1f3-511809d322dc
+44d2a25c-933c-4345-8d19-cc52daaa9f11
+fc25f498-455d-4a13-9ca4-9ed2b843da17
+f9737152-aa7c-47a3-b96f-d0560ccea84f
+\N
+c1140446-9885-4a23-a709-593c0ba3818d
+050474c6-e6f5-417f-bcb8-2cc288cc412c
+9f07cb2f-aec4-4108-a07a-ea51366043f2
+4d9cf071-119b-497d-88de-0d05d21bac34
+7f5de1dd-3848-4ad8-a0e6-fb4039eec4f8
+f97c4e03-e8ce-443f-846b-82485c8bf04d
+2354e08c-8415-4b24-8cc2-b7b7616b6588
+b0a5e7da-9382-4a9f-b64c-0c4e5c3755ca
+c4812583-5689-4384-8044-e200f796afee
+890b609b-ac04-4bf3-9070-492a5db11e1c
+b0789be3-59ad-44e5-b1c6-394df496ae1f
+512ee0f6-380b-4758-ae20-b10d578473a9
+ad84303a-90e0-44dd-a7a2-b6015e748067
+986947bf-e924-4fb8-bdec-bd91f1b9d634
+fa576306-7eb6-411d-aa92-9e67678530ee
+\N
+3d66ae17-f27e-45f0-8b95-d47821b1d09c
+e8f40639-2c3e-4802-96e1-b8ccf15762f1
+482c9541-9fa9-444f-8155-ceb86056f2f7
+f8dbf3c1-c67f-4a71-8bb1-b754d2fc4d9d
+4764906b-3b71-4ccf-80d2-fb985af7728a
+628312b0-5f3d-4856-a3b0-6e7f60dd19ee
+37b5c576-d2c0-40b5-91cf-712b41dea919
+e7eefe4c-e647-40ba-bde1-bf4aa780b0ab
+\N
+4089198b-e1f1-4cf5-aa74-1e32aef1f034
+\N
+5133a3c7-b9cd-4659-ad99-0453b433f237
+7d6c0ec0-0c7c-4a98-9d75-74a937b7ecba
+74faeb7e-e0ac-4505-b2c5-bad6a39c6abb
+ad895aff-3527-423b-bc82-607d9586f5fc
+19a14c87-ab30-4747-8dc4-7599b4015960
+44955907-c727-4cab-aec3-464332e444fa
+\N
+b5d4dc6b-b65b-4a36-8f16-cf9760631718
+\N
+49b4a368-b530-49ec-b8ed-7664c2dda4cc
+e70020b6-eeac-425b-a3ce-9f5ad642f371
+448473ab-2a0f-4200-b7a7-b7583002779e
+\N
+\N
+8a8b74f9-f49a-4f77-b6ab-2011df5645ca
+\N
+67ae0fa2-08c6-4566-92c4-adae5be3c3cc
+1453d200-133e-4df3-9723-eb43bd21d896
+a7f3072e-e567-4e23-9bd0-70aba0554281
+f9caa2e9-6d43-4559-a9e7-6e5d7e7b2769
+b6a0b42b-70a3-42e0-b623-9dee8e2d3b85
+\N
+05f2c97f-4c81-43a2-9c7b-8a1cf8de2474
+9287055b-ef1d-4b7f-bc28-fd637adaf530
+e0ed08d4-2521-46b1-983a-03c3cf915e42
+285a1259-f929-4e37-b25b-62af93fb1ea1
+d76631da-ace1-472c-a23d-7d4f2702f771
+80f89372-02be-4ad0-a1e5-9a2490769427
+\N
+3c1043f7-f77f-4788-abc7-5615804ccd69
+a3942f4f-27f4-44bf-bf28-6ae854d4d346
+3b741249-a9bd-452b-bd08-9ae337134f13
+5aea4b8f-7dbb-4b7a-ad1b-cee1d93a5393
+cae01e8c-e75d-4c3d-8d90-ee3ebdb011d0
+13aeefb0-dbba-4cee-b108-931f23e286b1
+\N
+40aee193-6c24-4a13-a004-9f4dec1ab2cf
+2b731fff-597d-4a6e-888c-2ec72fe0dbef
+4581b196-149e-492e-9053-5040207dcc19
+68d07598-261e-40bc-a2f5-e8f72cc86104
+94c1ecf0-2bdc-4d0f-962f-226a9617b8cb
+2fcfe646-edc5-4397-8032-c4b4cd88afce
+2ed39277-375a-4e9a-846d-660fe531bed2
+1244efdd-5d49-403a-9649-2550abae81f2
+281b757c-a039-4668-adf1-ff020ecf17ae
+10f75609-865a-4b80-b5b2-39c67aa70c33
+8fb26a73-0535-4603-961e-217353617786
+98a14b8f-9a24-4c1d-b823-26d07b3d0e30
+200890d3-e23d-42dd-85f2-e9e4961495e6
+0faebfcf-6202-4799-b302-40c258d546c3
+714a3c57-cfdf-4db4-81f7-8bc0b9119f51
+c4f0d33b-3b8d-46b7-af89-2f5cce9d495a
+\N
+0a00b315-9668-493d-ab38-48d20cb5756f
+a0a20648-1759-4330-94a3-e39746fdb30a
+02890263-b147-4323-b59b-d533ea9d436e
+ed12380e-14ff-4ec2-a47d-1b57dcd9cd68
+6d23b5ae-ca06-4aa7-a282-d96315c3ba83
+dac7a9bc-97e3-46e5-a543-ee4071ae9f0a
+65995243-a887-407f-b5de-f6b25b07e3a5
+4831f146-46fe-4d57-9569-80852b0f655b
+46037b99-bc54-4266-94cb-384c062346e4
+10661769-8d53-476e-9be4-440258481fdd
+5ddd5380-3f03-4a76-b682-b65e1ff1a431
+5e1fe5a5-14fd-46e9-afd2-54908de1582b
+62c070e4-7647-4c21-a4dd-cd8203ee6b20
+\N
+efd4c5c8-629d-41be-8982-e3b8352f96e2
+16a2c85a-f455-45bc-8a29-38f7f664fc7c
+0360c257-6ea8-4d6e-834f-43f37a7d8f4e
+e2562225-53fe-457e-b538-c089d3946aec
+ddbaebbe-8294-4f8d-8452-4a46d1b43c53
+dca63b45-648f-4b4c-a36a-c53f3e0abe28
+04e91983-21f7-408b-b4eb-aa6d9359f37a
+905c498a-4b99-49af-89cd-fd1d022193e7
+413d7f85-6bdd-4d50-8859-afd317c841c4
+412ca3ee-90e5-46ae-adf3-80aa6ceee633
+1a8020e7-8671-46e4-b2d3-705e206723bf
+9414f47f-088c-4fb1-98f2-bc020b0d550b
+8f48e9ef-ae2c-4d0a-acc6-8d4b18622df5
+614cbf04-fb3b-4678-834b-da05f70bd529
+0c96ce68-9135-4199-a351-05f9dfc641e2
+f3dfa1a0-c156-435e-9f2c-662c345b92db
+\N
+d7c6b8cc-2d67-41c6-bae0-3ab23f8ad65c
+b8ae6503-dbed-4455-85ce-6b985b4338ff
+3ba1530c-911b-463d-aa61-5d81850b5fcb
+\N
+0f71da52-80da-4bc5-88f7-013603f8ef06
+f59318ec-1851-4beb-b02e-6e9ca7f2391a
+8b712321-af06-4af2-8654-1e174851ae59
+\N
+\N
+c30e01ed-17eb-495d-8381-dc87cd280002
+10537620-20b9-4706-a1fb-ec470349e4d8
+bc669e4a-bef3-4635-a3c6-47e70a307e70
+5d965491-8d0d-4f7b-bab4-b615dd97dbcd
+fa76b0d2-1c46-4855-9381-3ec02b21b475
+311c71c5-e5e2-4224-aa57-fc79adb0d037
+82f18b3d-dd3c-402c-a54b-afe92a8b4582
+8a39cdbf-39c5-41a9-a4cb-c334cccc0414
+396ed0f3-8c28-40a8-a5d0-b41d2448c618
+4dc37b03-f161-4436-bb41-3e114f78bb96
+1de1ff4c-5b47-40d2-a002-ff331900c4ec
+7b248f50-920b-45f3-b20b-19d75590ef3d
+\N
+eba46805-9b82-4ebd-84d2-5aa6cb3d8a48
+2fef1c4c-d97c-423f-923d-cbac15961fc5
+7ae4af7a-3759-4ecb-9d3f-ed5e124ab08c
+f812e63b-20a4-4f58-90be-e6c7357d89fd
+cd91b9fe-5daa-4087-94a7-459c54d24d39
+54f4f7a3-c581-4bff-9bc1-82d8aaec2d3c
+\N
+d900a862-a0b2-4776-b418-af075881c53d
+593143fa-99b6-464b-b563-33e201668db0
+1d8ffc5d-1011-41d5-b3bc-18e0fe5b7375
+93773b54-be94-4b99-9bcc-e181f1b09978
+\N
+7fe6a809-a67e-46ef-b686-4a982a6f6fc1
+00c65908-2e09-4974-8c61-37ec926e74fc
+d6f2cc12-6d93-4159-b247-70db9120217b
+29806fd9-24bb-4e50-a228-8ad6c17559ab
+bd093e48-01be-4a09-a8f0-33a2bfcf23a7
+13d3db20-68e0-4cb2-8530-90648e6a756c
+b5bb9551-bb70-4589-a12c-15350d85232b
+6736895a-671b-435c-85b7-133c65b09cc8
+a609184a-9035-4b75-b10e-838465bace14
+98c084a0-9c30-4dc0-b8a2-2b818f650034
+122afe72-60e5-497a-92f7-c8139339f999
+6b2b6d77-f49c-4b37-a57f-c8ab6f8deff3
+6e133f18-5a70-4717-a750-1c2ee9ab459a
+\N
+\N
+96e2dc30-cc7e-4c9e-bbbc-e4af1ce9b5f6
+0a430277-f67d-44df-88e6-3ae2e78b8a1e
+15445ff0-2087-4fa6-857e-baba197a3ec9
+5a8aba7a-1feb-4acc-b57d-2520233ec15f
+a17ef384-5204-4240-a493-7db5dc28a6b2
+bfa0fd7d-7d18-4c57-a066-c94be05d0730
+4de53a8d-d76e-446e-9b68-48618314f2c4
+21cb20a2-36ab-4756-8925-cf8bade61148
+a2376936-9836-4397-a3eb-e779e498ab2d
+f4b3d211-79bb-4256-a460-26dac56d9755
+4c4be10f-5141-429a-9ea6-24eb1fbd5330
+a45bb987-b935-44ae-a410-c82b1f895eb5
+b341e29a-e069-4ba2-b2ba-279b53c1fcda
+68a4e4f8-9d7b-48f0-8614-e2a2072c859e
+dc20e7f1-b79d-4135-b90c-cd87a265169a
+1c5bfa73-8814-4f5d-9718-a12417814c41
+3000c028-3656-4455-b095-0b9f5ab1dc9e
+\N
+3d13811e-7b7a-4779-ab87-5257a1c702d1
+a9ea4067-e53c-484c-87ae-bdb218fbec40
+9c3925cc-4dba-4dd4-8000-c646f45db751
+f2e7334b-9840-4e9c-aff4-d7ac58ecbd91
+889d6968-a515-4458-a353-4a3d8d7528bd
+dc02f6d6-fec3-4c2f-ace2-6a124a61f079
+9f48ed94-313c-4607-9c23-d3a1b20eaca4
+\N
+\N
+2428f056-4dc2-4db1-a110-20bb54a3037a
+3cc8dd23-fd3a-4855-8ffa-23d1efa4fdbc
+bd3e2f1d-5869-42ff-b1c5-3f65ae2d1974
+\N
+\N
+8330c73d-0dc5-4caa-be02-10e136137804
+f202e559-6ab2-4b72-a6e3-1bf16cfe8bf5
+54e42957-25fa-46c7-a939-eaaa4b54a5b4
+\N
+7c3b2d81-44ca-49d1-8b08-c33f691c4f3c
+\N
+5083bb0b-7fa7-4ee1-8e51-ce20ee53a16c
+ffdd64de-2c27-4858-8baf-b179f0fa690c
+6e4632ce-f908-4c13-a15a-ac5cdca38c76
+e428a015-0cca-4b09-bb5c-ee4bffbd2de7
+\N
+\N
+d7a270ce-7ac4-49bf-a531-e56960f56850
+80b82b49-3984-4b6f-8690-7578f992d987
+824d6c6a-273d-4bfe-8ca6-197c8477d6c1
+\N
+\N
+5dddc93c-c4c9-44fc-8916-a826089245a4
+21357386-e17f-457e-93b4-77295904e67f
+f9598cd5-3c4c-457c-b6d8-11049bbc94b1
+05f7fbbb-1660-42da-a154-de4aa6cce4df
+a3b6aeef-e8b5-4692-944f-eb5edfd6a0b5
+cb8f1dea-fefa-470f-9a9c-1e169df844ec
+\N
+4b12759f-10e0-478c-b2d4-7c71be9f837e
+3688c161-bc5a-40a4-a9a9-6854b623a139
+\N
+a6a6ac8a-b805-4f15-bc8e-71c3679221e2
+ddcdad12-0919-4b8b-acc8-e775aaf6b6a1
+0dcce500-a4d6-4d34-916b-686cc04ceaa9
+2190bba9-e7e6-413a-85e3-40735e791c1b
+3f06e070-1530-47a7-8898-a94d82ea59b8
+bfb7ef50-9a5c-4341-a65d-c7b9ccb76d39
+70972a38-8f23-478c-abfd-9dbdca17dd01
+3c6ba50f-9197-4f0b-bf46-ca51aef246d1
+fb4598bf-ffa0-470e-b8eb-2d704fc08bd5
+fb2bd46e-6f43-4b2a-a122-dd6539ccc03c
+49f8d0a6-b7b0-444b-90dd-1cb5d08e95e5
+\N
+e8b02af9-8671-49d3-a1bf-86e222fe4ecc
+\N
+26c6af97-9ffc-43bd-a926-da45469c3c52
+773ec08a-9d02-4a8f-87e9-f4460d703952
+286f3446-6e5c-4b91-bb47-d6106346369f
+\N
+2e1c1f21-8cdb-4a33-96b2-85b3eec11e41
+d7b3ebc0-62a0-419a-a710-f9950d012f92
+3edde810-79fd-4f1f-aa10-4aa472d9384a
+a13013f8-e1cf-4902-9c95-8177d8a220a9
+b7c226d3-d115-4bf8-b03c-e7f14eee2169
+91a75836-a7a6-488b-806a-e8f948c8eb46
+b30da379-97b3-4a94-b6a2-2064767d2e52
+befec357-cf20-4712-9805-34910608e2fd
+ca95130e-1c44-4733-a872-c0ce24d1b3c1
+\N
+f5001512-9140-43c9-a4c8-54e26f71f1cf
+a3f2283e-50dd-40b9-83f3-b50dca485209
+3f7ac41e-bc09-4b74-8665-bdde3ebe47a7
+761e1883-d06e-4360-9df5-5c5caeef905c
+98cffbaf-dc52-4674-ade0-f930a70b64b2
+370e189c-b821-41ae-b748-a60b6d7660eb
+12563667-28cd-478d-b53c-442f7bf12c67
+\N
+29fe6754-ba91-49b4-bfb7-12b3dc03081c
+87aa5cc1-3332-4bf3-a669-5bb61e56a7ee
+\N
+8bcd3587-03fd-44a0-aab8-b8aca2bc9eb9
+9ae7c0f8-6038-48af-b01f-0c5bccac6c8f
+\N
+3e98dbdb-b10f-4f6d-a87a-c8f1f2b1e22a
+cd53b5ef-38fa-4d68-a8ff-4eb07f4162b5
+514644a8-fe52-4bab-8bb8-4cb8c7ef7acc
+\N
+b01b6978-46f9-46ec-844d-1322be2cfcb2
+04675ff9-2d55-413d-a3d0-4ac0ff1d3a54
+a7ee0137-c56a-472c-b4cb-dc41f1177ef0
+bc41bfcd-e5f0-423d-82f7-ffb7da97b5dd
+55824064-db88-4077-ad90-945d878e88ba
+a30050dd-1a17-4659-b3a6-c4c182ff0184
+82ffa955-b664-4503-9b1c-095404dbff48
+91d67d53-ec53-4dae-95ca-da25c1cfae7d
+da144505-c151-42a4-b8d5-19ff810ae6ea
+cfa1ddf5-6149-4896-940e-5dc57e4ec766
+c3a56789-f97f-4d5a-b70a-7d24da43bc5f
+4547a150-68f8-4984-b7b4-67ee92315b6a
+6b6d5e01-b18d-4afd-8b6e-8c3af536efe4
+bf723c93-f506-4990-9e97-b65476044b30
+c3ec8969-1f70-4b19-977b-237ede99a6a5
+78f11bd7-7a10-42ae-9475-eb16ca80f1e0
+cb3bf2fe-2d6c-47e7-b1e7-ce3254d2f800
+3842e996-3d91-4cab-8cce-da007a08328b
+4c55e078-603b-4d4e-9c77-c747960f6aff
+16d9f806-448d-48a1-9473-4d30df05aab8
+4611148b-cf71-40e6-829f-95ae0f2c8094
+9f3bcfbc-24ea-4105-8cb8-37a0924ff5e2
+4fac2eaa-2bd1-4d9c-bd80-a7ae083efcf9
+dc5546ca-99fc-4c1d-9559-b2ed9cd3d2aa
+29721775-9930-4f6c-af20-bb5b5f8d0d73
+f39a6eac-e7d5-4124-9a65-9508bfc53920
+\N
+7bc9960c-cf4f-4cca-a752-b28c5805ae01
+0e1c03e3-2cca-4bc8-b160-d6c2e888c182
+b12bb0d6-45d3-4608-9992-be9804a09448
+31bc67c6-1293-47c0-9732-5094e0b996bc
+a262ce01-cdf9-47f4-8f48-e94d4b9d73ce
+bc7150a9-0593-444c-b7b7-cc142348f1b4
+2f1e9e36-7e1b-49a5-a83e-b330267b5051
+f919c11a-b74f-4543-9798-da31133f90b5
+8672777e-a462-4042-9604-4392bbbd3308
+37b53421-3c74-40f5-9884-b83033e9f596
+1f843010-c79a-4bd4-a0a5-0251e0389722
+c51ecb09-45b4-40ff-9934-877c168c5038
+131335ce-a059-49c4-81ae-c9d98211ff9c
+f467b40d-0c6e-40b9-9959-2f7f466f18e2
+44076ea8-1103-4086-9e7d-8bfb9a65893d
+79ca8799-36a4-4982-9cd7-bf93fca45d74
+82569d43-65a3-44d7-8836-2db6de03e6f7
+cb5380e0-b075-48e6-8a9a-eee854444d34
+db88f31c-ce62-43f3-9781-8a8404e6ba39
+78f33ab0-a744-4bf1-82a7-c0b319492607
+2e4b580e-7d69-42c8-9f1d-7f232a3ae74c
+427b3d53-2792-47d3-9d45-087b30568413
+40518971-9590-45fb-9219-242ab3053547
+fe49087f-d8c1-4769-b814-fd8bc1611b5c
+27f8a8ab-671e-4eb2-88b4-2ad41814df1c
+39ebe842-6c44-4fb1-a629-3f86323ca5ea
+4a341b56-3523-4163-8563-83b9db172673
+513dd3a8-7354-47e7-9eef-d2a9e59a0e18
+b8e38294-7be9-4c39-b80f-bf2c9acfe69f
+e1fa23c2-b0b6-47b3-82c9-eef6e930af08
+1b86903e-c395-42c7-b9ad-1a71a1fb52d1
+632161a2-474e-450c-9b70-0f09f512bcba
+73f00c2b-ea38-46bb-aae3-4cf205572baf
+013839fd-03de-4fe5-a08c-466670de6cbd
+5d951cfe-d988-4b69-bce8-37d66598cbc3
+4da7e8f1-edaf-404a-bd1b-e8dd3a838fe2
+1f2c1809-8b85-48e8-ada4-1fdb418fea0e
+\N
+1bde5bbb-5d63-4d00-b227-1a706315eaa1
+f7ebf8f8-609f-4ce9-b93c-54759305926e
+\N
+7c2dd991-9377-4001-8486-7f3c3a6bae9c
+9fe1e97c-718b-4cf2-b270-4e0b664aaf27
+2141a8f5-da01-47cc-8104-6dd28874d8ac
+304096e8-b118-41e0-8174-32dc8e1fc45d
+9d5fac3d-e6f2-4341-9e59-9a155bef7b17
+b42cebe1-f01f-4409-bfc2-150aa9f13159
+91adc8a2-266c-4196-99ff-1de1c361c3ef
+54d26aee-0309-4af7-9b12-bbb24eb3e4e1
+bd449351-c50a-43b2-9742-1bcb838d4d04
+9fe70798-e3bd-448a-b461-e462702a9aca
+\N
+c8ef8969-1332-481b-909a-340ff3fd4473
+64c68c64-f815-4bd7-b0aa-ba68bb15f611
+9f271158-ff4e-41a6-a883-913f2b36ae68
+\N
+b1082d66-0065-41ac-9bc5-dcea0bbec070
+\N
+3ac2d674-2e12-4db1-b998-2470cba43b11
+\N
+3061f573-96e9-4307-a683-df8ab30531a5
+01ce8c0e-7672-4023-be71-5dfae5ffa7d2
+06a9e327-29ea-4913-b6b9-90781484eff4
+9735f9eb-89b3-4f42-bfb5-e2bb208b640a
+21ef890c-1c8c-4890-8c6d-851eebe68f40
+c35686c4-cfcc-48ff-b6d9-7c8da68dceb1
+3f08e734-1f52-42b5-ba89-738582a7f5b4
+12975217-8a58-4a95-9ede-4ceb0a487a67
+97e186f8-28a7-4340-b781-cd13168daf99
+2336ce4b-3d57-46f4-b460-cdeb89c81fcd
+e824b114-66e0-441f-aa94-27feb7a3f672
+b8bf5230-0174-4f16-9470-dd476b9675d6
diff --git a/contrib/btree_gist/expected/uuid.out b/contrib/btree_gist/expected/uuid.out
new file mode 100644
index 0000000..a34b024
--- /dev/null
+++ b/contrib/btree_gist/expected/uuid.out
@@ -0,0 +1,66 @@
+-- uuid check
+CREATE TABLE uuidtmp (a uuid);
+\copy uuidtmp from 'data/uuid.data'
+SET enable_seqscan=on;
+SELECT count(*) FROM uuidtmp WHERE a <  '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+ count 
+-------
+   227
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a <= '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+ count 
+-------
+   228
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a  = '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+ count 
+-------
+     1
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a >= '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+ count 
+-------
+   376
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a >  '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+ count 
+-------
+   375
+(1 row)
+
+CREATE INDEX uuididx ON uuidtmp USING gist ( a );
+SET enable_seqscan=off;
+SELECT count(*) FROM uuidtmp WHERE a <  '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+ count 
+-------
+   227
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a <= '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+ count 
+-------
+   228
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a  = '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+ count 
+-------
+     1
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a >= '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+ count 
+-------
+   376
+(1 row)
+
+SELECT count(*) FROM uuidtmp WHERE a >  '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+ count 
+-------
+   375
+(1 row)
+
diff --git a/contrib/btree_gist/sql/uuid.sql b/contrib/btree_gist/sql/uuid.sql
new file mode 100644
index 0000000..3f7ad76
--- /dev/null
+++ b/contrib/btree_gist/sql/uuid.sql
@@ -0,0 +1,31 @@
+-- uuid check
+
+CREATE TABLE uuidtmp (a uuid);
+
+\copy uuidtmp from 'data/uuid.data'
+
+SET enable_seqscan=on;
+
+SELECT count(*) FROM uuidtmp WHERE a <  '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+
+SELECT count(*) FROM uuidtmp WHERE a <= '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+
+SELECT count(*) FROM uuidtmp WHERE a  = '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+
+SELECT count(*) FROM uuidtmp WHERE a >= '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+
+SELECT count(*) FROM uuidtmp WHERE a >  '55e65ca2-4136-4a4b-ba78-cd3fe4678203';
+
+CREATE INDEX uuididx ON uuidtmp USING gist ( a );
+
+SET enable_seqscan=off;
+
+SELECT count(*) FROM uuidtmp WHERE a <  '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+
+SELECT count(*) FROM uuidtmp WHERE a <= '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+
+SELECT count(*) FROM uuidtmp WHERE a  = '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+
+SELECT count(*) FROM uuidtmp WHERE a >= '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
+
+SELECT count(*) FROM uuidtmp WHERE a >  '55e65ca2-4136-4a4b-ba78-cd3fe4678203'::uuid;
diff --git a/doc/src/sgml/btree-gist.sgml b/doc/src/sgml/btree-gist.sgml
index f4afc09..d08647c 100644
--- a/doc/src/sgml/btree-gist.sgml
+++ b/doc/src/sgml/btree-gist.sgml
@@ -16,7 +16,8 @@
   <type>time without time zone</>, <type>date</>, <type>interval</>,
   <type>oid</>, <type>money</>, <type>char</>,
   <type>varchar</>, <type>text</>, <type>bytea</>, <type>bit</>,
-  <type>varbit</>, <type>macaddr</>, <type>inet</>, and <type>cidr</>.
+  <type>varbit</>, <type>macaddr</>, <type>inet</>, <type>cidr</>,
+  and <type>uuid</>.
  </para>
 
  <para>
@@ -98,9 +99,10 @@ INSERT 0 1
   <title>Authors</title>
 
   <para>
-   Teodor Sigaev (<email>teo...@stack.net</email>) ,
-   Oleg Bartunov (<email>o...@sai.msu.su</email>), and
-   Janko Richter (<email>jankorich...@yahoo.de</email>).  See
+   Teodor Sigaev (<email>teo...@stack.net</email>),
+   Oleg Bartunov (<email>o...@sai.msu.su</email>),
+   Janko Richter (<email>jankorich...@yahoo.de</email>), and
+   Paul Jungwirth (<email>p...@illuminatedcomputing.com</email>).  See
    <ulink url="http://www.sai.msu.su/~megera/postgres/gist/";></ulink>
    for additional information.
   </para>
diff --git a/src/backend/utils/adt/uuid.c b/src/backend/utils/adt/uuid.c
index 592877d..fc2439f 100644
--- a/src/backend/utils/adt/uuid.c
+++ b/src/backend/utils/adt/uuid.c
@@ -25,8 +25,8 @@
 /* uuid size in bytes */
 #define UUID_LEN 16
 
-/* pg_uuid_t is declared to be struct pg_uuid_t in uuid.h */
-struct pg_uuid_t
+/* pg_uuid_t is declared to be union pg_uuid_t in uuid.h */
+union pg_uuid_t
 {
 	unsigned char data[UUID_LEN];
 };
diff --git a/src/include/utils/uuid.h b/src/include/utils/uuid.h
index 9d97fed4..ed84eb1 100644
--- a/src/include/utils/uuid.h
+++ b/src/include/utils/uuid.h
@@ -18,7 +18,7 @@
 #define UUID_LEN 16
 
 /* opaque struct; defined in uuid.c */
-typedef struct pg_uuid_t pg_uuid_t;
+typedef union pg_uuid_t pg_uuid_t;
 
 /* fmgr interface macros */
 #define UUIDPGetDatum(X)		PointerGetDatum(X)
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to