mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
b663f3443b
with OPAQUE, as per recent pghackers discussion. I still want to do some more work on the 'cstring' pseudo-type, but I'm going to commit the bulk of the changes now before the tree starts shifting under me ...
82 lines
2.3 KiB
MySQL
82 lines
2.3 KiB
MySQL
begin transaction;
|
|
|
|
-- Adjust this setting to control where the objects get created.
|
|
SET search_path = public;
|
|
|
|
--
|
|
--
|
|
--
|
|
-- BOX ops
|
|
--
|
|
--
|
|
--
|
|
-- define the GiST support methods
|
|
create function gbox_consistent(internal,box,int4) returns bool as 'MODULE_PATHNAME' language 'C';
|
|
|
|
create function gbox_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
|
|
|
|
create function rtree_decompress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
|
|
|
|
create function gbox_penalty(internal,internal,internal) returns internal as 'MODULE_PATHNAME' language 'C' with (isstrict);
|
|
|
|
create function gbox_picksplit(internal, internal) returns internal as 'MODULE_PATHNAME' language 'C';
|
|
|
|
create function gbox_union(bytea, internal) returns box as 'MODULE_PATHNAME' language 'C';
|
|
|
|
create function gbox_same(box, box, internal) returns internal as 'MODULE_PATHNAME' language 'C';
|
|
|
|
-- create the operator class
|
|
CREATE OPERATOR CLASS gist_box_ops
|
|
DEFAULT FOR TYPE box USING gist AS
|
|
OPERATOR 1 << ,
|
|
OPERATOR 2 &< ,
|
|
OPERATOR 3 && ,
|
|
OPERATOR 4 &> ,
|
|
OPERATOR 5 >> ,
|
|
OPERATOR 6 ~= ,
|
|
OPERATOR 7 ~ ,
|
|
OPERATOR 8 @ ,
|
|
FUNCTION 1 gbox_consistent (internal, box, int4),
|
|
FUNCTION 2 gbox_union (bytea, internal),
|
|
FUNCTION 3 gbox_compress (internal),
|
|
FUNCTION 4 rtree_decompress (internal),
|
|
FUNCTION 5 gbox_penalty (internal, internal, internal),
|
|
FUNCTION 6 gbox_picksplit (internal, internal),
|
|
FUNCTION 7 gbox_same (box, box, internal);
|
|
|
|
|
|
--
|
|
--
|
|
--
|
|
-- POLYGON ops
|
|
--
|
|
--
|
|
--
|
|
-- define the GiST support methods
|
|
create function gpoly_consistent(internal,polygon,int4) returns bool as 'MODULE_PATHNAME' language 'C';
|
|
|
|
create function gpoly_compress(internal) returns internal as 'MODULE_PATHNAME' language 'C';
|
|
|
|
-- create the operator class
|
|
CREATE OPERATOR CLASS gist_poly_ops
|
|
DEFAULT FOR TYPE polygon USING gist AS
|
|
OPERATOR 1 << RECHECK ,
|
|
OPERATOR 2 &< RECHECK ,
|
|
OPERATOR 3 && RECHECK ,
|
|
OPERATOR 4 &> RECHECK ,
|
|
OPERATOR 5 >> RECHECK ,
|
|
OPERATOR 6 ~= RECHECK ,
|
|
OPERATOR 7 ~ RECHECK ,
|
|
OPERATOR 8 @ RECHECK ,
|
|
FUNCTION 1 gpoly_consistent (internal, polygon, int4),
|
|
FUNCTION 2 gbox_union (bytea, internal),
|
|
FUNCTION 3 gpoly_compress (internal),
|
|
FUNCTION 4 rtree_decompress (internal),
|
|
FUNCTION 5 gbox_penalty (internal, internal, internal),
|
|
FUNCTION 6 gbox_picksplit (internal, internal),
|
|
FUNCTION 7 gbox_same (box, box, internal),
|
|
STORAGE box;
|
|
|
|
|
|
end transaction;
|