Thread: Geometry RESTRICT and JOIN

Geometry RESTRICT and JOIN

From
Paul Matthews
Date:
I'm trying to add all the "box op point" operators. The C routines are
written and working as advertised. The manuals description of the
RESTRICT and JOIN clauses of CREATE OPERATOR don't seem too clear. Are
these samples correct, or am I totally off base here?

CREATE OPERATOR << ( LEFTARG    = box, RIGHTARG   = point, PROCEDURE  = leftof, RESTRICT   = scalarltsel,     -- ??
UNSUREJOIN       = positionjoinsel  -- ?? UNCLEAR
 
);

CREATE OPERATOR &> ( LEFTARG    = box, RIGHTARG   = point, PROCEDURE  = notleft, RESTRICT   = scalargtsel,     -- ??
UNSUREJOIN       = positionjoinsel  -- ?? UNCLEAR
 
);

CREATE OPERATOR @> ( LEFTARG    = box, RIGHTARG   = point, PROCEDURE  = contains, RESTRICT   = eqsel,           -- ??
UNSUREJOIN       = contjoinsel      -- ?? UNCLEAR
 
);

...etc...



Re: Geometry RESTRICT and JOIN

From
Tom Lane
Date:
Paul Matthews <plm@netspace.net.au> writes:
> I'm trying to add all the "box op point" operators. The C routines are
> written and working as advertised. The manuals description of the
> RESTRICT and JOIN clauses of CREATE OPERATOR don't seem too clear. Are
> these samples correct, or am I totally off base here?

Well, I'm pretty sure you don't want the scalar selectivity functions
for any of these.  IIRC the geometric selectivity functions already
come in pairs, eg you should use contsel and contjoinsel for @>.
        regards, tom lane