2010-09-21 04:08:53 +08:00
|
|
|
/* contrib/seg/seg.sql.in */
|
2007-11-13 12:24:29 +08:00
|
|
|
|
2002-07-31 01:34:37 +08:00
|
|
|
-- Adjust this setting to control where the objects get created.
|
|
|
|
SET search_path = public;
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
-- Create the user-defined type for 1-D floating point intervals (seg)
|
2010-11-24 04:27:50 +08:00
|
|
|
--
|
2007-11-11 11:25:35 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION seg_in(cstring)
|
2002-08-22 08:01:51 +08:00
|
|
|
RETURNS seg
|
2000-12-12 04:40:33 +08:00
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_out(seg)
|
2002-08-22 08:01:51 +08:00
|
|
|
RETURNS cstring
|
2000-12-12 04:40:33 +08:00
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
CREATE TYPE seg (
|
2002-10-19 02:41:22 +08:00
|
|
|
INTERNALLENGTH = 12,
|
|
|
|
INPUT = seg_in,
|
|
|
|
OUTPUT = seg_out
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
COMMENT ON TYPE seg IS
|
|
|
|
'floating point interval ''FLOAT .. FLOAT'', ''.. FLOAT'', ''FLOAT ..'' or ''FLOAT''';
|
|
|
|
|
|
|
|
--
|
|
|
|
-- External C-functions for R-tree methods
|
|
|
|
--
|
|
|
|
|
|
|
|
-- Left/Right methods
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_over_left(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_over_left(seg, seg) IS
|
2005-06-27 08:48:07 +08:00
|
|
|
'overlaps or is left of';
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_over_right(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_over_right(seg, seg) IS
|
2005-06-27 08:48:07 +08:00
|
|
|
'overlaps or is right of';
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_left(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_left(seg, seg) IS
|
|
|
|
'is left of';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_right(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_right(seg, seg) IS
|
|
|
|
'is right of';
|
|
|
|
|
|
|
|
|
2005-06-27 08:48:07 +08:00
|
|
|
-- Scalar comparison methods
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_lt(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_lt(seg, seg) IS
|
|
|
|
'less than';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_le(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_le(seg, seg) IS
|
|
|
|
'less than or equal';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_gt(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_gt(seg, seg) IS
|
|
|
|
'greater than';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_ge(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_ge(seg, seg) IS
|
|
|
|
'greater than or equal';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_contains(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_contains(seg, seg) IS
|
|
|
|
'contains';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_contained(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_contained(seg, seg) IS
|
|
|
|
'contained in';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_overlap(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_overlap(seg, seg) IS
|
|
|
|
'overlaps';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_same(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_same(seg, seg) IS
|
|
|
|
'same as';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_different(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_different(seg, seg) IS
|
|
|
|
'different';
|
|
|
|
|
|
|
|
-- support routines for indexing
|
|
|
|
|
2003-09-14 10:18:49 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_cmp(seg, seg)
|
|
|
|
RETURNS int4
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2003-09-14 10:18:49 +08:00
|
|
|
|
|
|
|
COMMENT ON FUNCTION seg_cmp(seg, seg) IS 'btree comparison function';
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_union(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS seg
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_inter(seg, seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS seg
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_size(seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS float4
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
-- miscellaneous
|
|
|
|
|
2008-04-19 02:43:09 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_center(seg)
|
|
|
|
RETURNS float4
|
|
|
|
AS 'MODULE_PATHNAME'
|
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_upper(seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS float4
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION seg_lower(seg)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS float4
|
|
|
|
AS 'MODULE_PATHNAME'
|
2006-02-28 00:09:50 +08:00
|
|
|
LANGUAGE C STRICT IMMUTABLE;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- OPERATORS
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE OPERATOR < (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_lt,
|
|
|
|
COMMUTATOR = '>',
|
|
|
|
NEGATOR = '>=',
|
|
|
|
RESTRICT = scalarltsel,
|
|
|
|
JOIN = scalarltjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR <= (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_le,
|
|
|
|
COMMUTATOR = '>=',
|
|
|
|
NEGATOR = '>',
|
|
|
|
RESTRICT = scalarltsel,
|
|
|
|
JOIN = scalarltjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR > (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_gt,
|
|
|
|
COMMUTATOR = '<',
|
|
|
|
NEGATOR = '<=',
|
|
|
|
RESTRICT = scalargtsel,
|
|
|
|
JOIN = scalargtjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR >= (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_ge,
|
|
|
|
COMMUTATOR = '<=',
|
|
|
|
NEGATOR = '<',
|
|
|
|
RESTRICT = scalargtsel,
|
|
|
|
JOIN = scalargtjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR << (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_left,
|
|
|
|
COMMUTATOR = '>>',
|
|
|
|
RESTRICT = positionsel,
|
|
|
|
JOIN = positionjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR &< (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_over_left,
|
|
|
|
RESTRICT = positionsel,
|
|
|
|
JOIN = positionjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR && (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_overlap,
|
|
|
|
COMMUTATOR = '&&',
|
2005-06-27 08:48:07 +08:00
|
|
|
RESTRICT = areasel,
|
|
|
|
JOIN = areajoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR &> (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_over_right,
|
|
|
|
RESTRICT = positionsel,
|
|
|
|
JOIN = positionjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR >> (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_right,
|
|
|
|
COMMUTATOR = '<<',
|
|
|
|
RESTRICT = positionsel,
|
|
|
|
JOIN = positionjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR = (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_same,
|
|
|
|
COMMUTATOR = '=',
|
|
|
|
NEGATOR = '<>',
|
|
|
|
RESTRICT = eqsel,
|
|
|
|
JOIN = eqjoinsel,
|
2003-09-14 10:18:49 +08:00
|
|
|
MERGES
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR <> (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_different,
|
|
|
|
COMMUTATOR = '<>',
|
|
|
|
NEGATOR = '=',
|
|
|
|
RESTRICT = neqsel,
|
|
|
|
JOIN = neqjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
2006-09-11 01:36:52 +08:00
|
|
|
CREATE OPERATOR @> (
|
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_contains,
|
|
|
|
COMMUTATOR = '<@',
|
|
|
|
RESTRICT = contsel,
|
|
|
|
JOIN = contjoinsel
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR <@ (
|
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_contained,
|
|
|
|
COMMUTATOR = '@>',
|
|
|
|
RESTRICT = contsel,
|
|
|
|
JOIN = contjoinsel
|
|
|
|
);
|
|
|
|
|
|
|
|
-- obsolete:
|
2000-12-12 04:40:33 +08:00
|
|
|
CREATE OPERATOR @ (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_contains,
|
|
|
|
COMMUTATOR = '~',
|
|
|
|
RESTRICT = contsel,
|
|
|
|
JOIN = contjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE OPERATOR ~ (
|
2002-10-19 02:41:22 +08:00
|
|
|
LEFTARG = seg,
|
|
|
|
RIGHTARG = seg,
|
|
|
|
PROCEDURE = seg_contained,
|
|
|
|
COMMUTATOR = '@',
|
|
|
|
RESTRICT = contsel,
|
|
|
|
JOIN = contjoinsel
|
2000-12-12 04:40:33 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
-- define the GiST support methods
|
2008-04-15 01:05:34 +08:00
|
|
|
CREATE OR REPLACE FUNCTION gseg_consistent(internal,seg,int,oid,internal)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2009-06-12 02:30:03 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION gseg_compress(internal)
|
2010-11-24 04:27:50 +08:00
|
|
|
RETURNS internal
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME'
|
2009-06-12 02:30:03 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION gseg_decompress(internal)
|
2010-11-24 04:27:50 +08:00
|
|
|
RETURNS internal
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME'
|
2009-06-12 02:30:03 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION gseg_penalty(internal,internal,internal)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS internal
|
|
|
|
AS 'MODULE_PATHNAME'
|
2009-06-12 02:30:03 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION gseg_picksplit(internal, internal)
|
2002-10-19 02:41:22 +08:00
|
|
|
RETURNS internal
|
|
|
|
AS 'MODULE_PATHNAME'
|
2009-06-12 02:30:03 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION gseg_union(internal, internal)
|
2010-11-24 04:27:50 +08:00
|
|
|
RETURNS seg
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME'
|
2009-06-12 02:30:03 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
2007-11-11 11:25:35 +08:00
|
|
|
CREATE OR REPLACE FUNCTION gseg_same(seg, seg, internal)
|
2010-11-24 04:27:50 +08:00
|
|
|
RETURNS internal
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME'
|
2009-06-12 02:30:03 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2000-12-12 04:40:33 +08:00
|
|
|
|
|
|
|
|
2003-09-14 10:18:49 +08:00
|
|
|
-- Create the operator classes for indexing
|
|
|
|
|
|
|
|
CREATE OPERATOR CLASS seg_ops
|
|
|
|
DEFAULT FOR TYPE seg USING btree AS
|
|
|
|
OPERATOR 1 < ,
|
|
|
|
OPERATOR 2 <= ,
|
|
|
|
OPERATOR 3 = ,
|
|
|
|
OPERATOR 4 >= ,
|
|
|
|
OPERATOR 5 > ,
|
|
|
|
FUNCTION 1 seg_cmp(seg, seg);
|
2002-07-31 01:34:37 +08:00
|
|
|
|
|
|
|
CREATE OPERATOR CLASS gist_seg_ops
|
2010-11-24 04:27:50 +08:00
|
|
|
DEFAULT FOR TYPE seg USING gist
|
2002-10-19 02:41:22 +08:00
|
|
|
AS
|
2002-07-31 01:34:37 +08:00
|
|
|
OPERATOR 1 << ,
|
|
|
|
OPERATOR 2 &< ,
|
|
|
|
OPERATOR 3 && ,
|
|
|
|
OPERATOR 4 &> ,
|
|
|
|
OPERATOR 5 >> ,
|
|
|
|
OPERATOR 6 = ,
|
2006-09-11 01:36:52 +08:00
|
|
|
OPERATOR 7 @> ,
|
|
|
|
OPERATOR 8 <@ ,
|
|
|
|
OPERATOR 13 @ ,
|
|
|
|
OPERATOR 14 ~ ,
|
2008-04-15 01:05:34 +08:00
|
|
|
FUNCTION 1 gseg_consistent (internal, seg, int, oid, internal),
|
2004-03-30 23:45:33 +08:00
|
|
|
FUNCTION 2 gseg_union (internal, internal),
|
2002-08-22 08:01:51 +08:00
|
|
|
FUNCTION 3 gseg_compress (internal),
|
|
|
|
FUNCTION 4 gseg_decompress (internal),
|
|
|
|
FUNCTION 5 gseg_penalty (internal, internal, internal),
|
|
|
|
FUNCTION 6 gseg_picksplit (internal, internal),
|
|
|
|
FUNCTION 7 gseg_same (seg, seg, internal);
|