Trying to solve this problem by using a process of elimination. All
works fine until the comment below is removed.
ALTER OPERATOR FAMILY box_ops USING GiST ADD
OPERATOR 1 << (box,point),
OPERATOR 2 &< (box,point),
OPERATOR 3 && (box,point),
OPERATOR 4 &> (box,point),
OPERATOR 5 >> (box,point),
-- OPERATOR 7 @> (box,point),
OPERATOR 9 &<| (box,point),
OPERATOR 10 <<| (box,point),
OPERATOR 11 |>> (box,point);
Ah! So operator @> is wrong.
DROP OPERATOR IF EXISTS @>(box,point);
CREATE OPERATOR @> (
LEFTARG = box,
RIGHTARG = point,
PROCEDURE = contains,
COMMUTATOR = <@,
RESTRICT = contsel,
JOIN = contjoinsel
);
No, all seems fine here. Maybe the definition of the function is incorrect
CREATE OR REPLACE FUNCTION contains(box,point) RETURNS boolean
LANGUAGE C IMMUTABLE STRICT
AS 'contains.so', 'box_point_contains';
The C function? No it seems OK as well. What am I missing? It must be
completely obvious. Someone is laughing out there. Put me out of my
misery please!
/*
* Box contains point. box @> point.
*/
Datum box_point_contains(PG_FUNCTION_ARGS)
{
BOX *box = PG_GETARG_BOX_P(0);
Point *point = PG_GETARG_POINT_P(1);
int isin = point->x >= box->low.x &&
point->x <= box->high.x &&
point->y >= box->low.y &&
point->y <= box->high.y;
PG_RETURN_BOOL(isin);
}
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers