diff options
Diffstat (limited to 'contrib/rtree_gist')
-rw-r--r-- | contrib/rtree_gist/rtree_gist.c | 40 | ||||
-rw-r--r-- | contrib/rtree_gist/rtree_gist.sql.in | 10 |
2 files changed, 41 insertions, 9 deletions
diff --git a/contrib/rtree_gist/rtree_gist.c b/contrib/rtree_gist/rtree_gist.c index f4ce58460fb..d6292b803e8 100644 --- a/contrib/rtree_gist/rtree_gist.c +++ b/contrib/rtree_gist/rtree_gist.c @@ -1,13 +1,13 @@ /*------------------------------------------------------------------------- * * rtree_gist.c - * pg_amproc entries for GiSTs over 2-D boxes. + * pg_amproc entries for GiSTs over 2-D boxes and polygons. * * This gives R-tree behavior, with Guttman's poly-time split algorithm. * * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/rtree_gist/rtree_gist.c,v 1.13 2005/06/24 00:18:52 tgl Exp $ + * $PostgreSQL: pgsql/contrib/rtree_gist/rtree_gist.c,v 1.14 2005/06/24 20:53:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -23,8 +23,8 @@ typedef Datum (*BINARY_UNION) (Datum, Datum, int *); typedef float (*SIZE_BOX) (Datum); /* -** box ops -*/ + * box ops + */ PG_FUNCTION_INFO_V1(gbox_compress); PG_FUNCTION_INFO_V1(gbox_union); PG_FUNCTION_INFO_V1(gbox_picksplit); @@ -43,8 +43,8 @@ static bool gbox_leaf_consistent(BOX *key, BOX *query, StrategyNumber strategy); static float size_box(Datum box); /* -** Polygon ops -*/ + * Polygon ops + */ PG_FUNCTION_INFO_V1(gpoly_compress); PG_FUNCTION_INFO_V1(gpoly_consistent); @@ -52,8 +52,8 @@ Datum gpoly_compress(PG_FUNCTION_ARGS); Datum gpoly_consistent(PG_FUNCTION_ARGS); /* -** Common rtree-function (for all ops) -*/ + * Common rtree-function (for all ops) + */ static bool rtree_internal_consistent(BOX *key, BOX *query, StrategyNumber strategy); PG_FUNCTION_INFO_V1(rtree_decompress); @@ -441,6 +441,18 @@ gbox_leaf_consistent(BOX *key, case RTContainedByStrategyNumber: retval = DatumGetBool(DirectFunctionCall2(box_contained, PointerGetDatum(key), PointerGetDatum(query))); break; + case RTOverBelowStrategyNumber: + retval = DatumGetBool(DirectFunctionCall2(box_overbelow, PointerGetDatum(key), PointerGetDatum(query))); + break; + case RTBelowStrategyNumber: + retval = DatumGetBool(DirectFunctionCall2(box_below, PointerGetDatum(key), PointerGetDatum(query))); + break; + case RTAboveStrategyNumber: + retval = DatumGetBool(DirectFunctionCall2(box_above, PointerGetDatum(key), PointerGetDatum(query))); + break; + case RTOverAboveStrategyNumber: + retval = DatumGetBool(DirectFunctionCall2(box_overabove, PointerGetDatum(key), PointerGetDatum(query))); + break; default: retval = FALSE; } @@ -558,6 +570,18 @@ rtree_internal_consistent(BOX *key, case RTContainedByStrategyNumber: retval = DatumGetBool(DirectFunctionCall2(box_overlap, PointerGetDatum(key), PointerGetDatum(query))); break; + case RTOverBelowStrategyNumber: + retval = !DatumGetBool(DirectFunctionCall2(box_above, PointerGetDatum(key), PointerGetDatum(query))); + break; + case RTBelowStrategyNumber: + retval = !DatumGetBool(DirectFunctionCall2(box_overabove, PointerGetDatum(key), PointerGetDatum(query))); + break; + case RTAboveStrategyNumber: + retval = !DatumGetBool(DirectFunctionCall2(box_overbelow, PointerGetDatum(key), PointerGetDatum(query))); + break; + case RTOverAboveStrategyNumber: + retval = !DatumGetBool(DirectFunctionCall2(box_below, PointerGetDatum(key), PointerGetDatum(query))); + break; default: retval = FALSE; } diff --git a/contrib/rtree_gist/rtree_gist.sql.in b/contrib/rtree_gist/rtree_gist.sql.in index 2fc38a7024e..e59edcacff0 100644 --- a/contrib/rtree_gist/rtree_gist.sql.in +++ b/contrib/rtree_gist/rtree_gist.sql.in @@ -27,7 +27,7 @@ LANGUAGE 'C'; CREATE FUNCTION gbox_penalty(internal,internal,internal) RETURNS internal AS 'MODULE_PATHNAME' -LANGUAGE 'C' with (isstrict); +LANGUAGE 'C' STRICT; CREATE FUNCTION gbox_picksplit(internal, internal) RETURNS internal @@ -56,6 +56,10 @@ AS OPERATOR 6 ~= , OPERATOR 7 ~ , OPERATOR 8 @ , + OPERATOR 9 &<| , + OPERATOR 10 <<| , + OPERATOR 11 |>> , + OPERATOR 12 |&> , FUNCTION 1 gbox_consistent (internal, box, int4), FUNCTION 2 gbox_union (internal, internal), FUNCTION 3 gbox_compress (internal), @@ -95,6 +99,10 @@ AS OPERATOR 6 ~= RECHECK, OPERATOR 7 ~ RECHECK, OPERATOR 8 @ RECHECK, + OPERATOR 9 &<| RECHECK, + OPERATOR 10 <<| RECHECK, + OPERATOR 11 |>> RECHECK, + OPERATOR 12 |&> RECHECK, FUNCTION 1 gpoly_consistent (internal, polygon, int4), FUNCTION 2 gbox_union (internal, internal), FUNCTION 3 gpoly_compress (internal), |