[postgis-devel] Prepared Geometry API

Paul Ramsey pramsey at cleverelephant.ca
Mon Oct 6 11:48:16 PDT 2008


The answer seems to be that, for data in tables, this works OK, but
for literals, it's possible for different literals to get the same
datum number:

select a.val as a, b.val as b, st_contains(a.val, b.val, 0) from
(select 'POINT(0 0)' as val union select 'POINT(1 1)' as val) a,
(select 'POINT(0 0)' as val union select 'POINT(1 1)' as val) b;

This ends up returning the same datum number for 0,0 as well as 1,1. :(

P.

On Mon, Oct 6, 2008 at 11:23 AM, Paul Ramsey <pramsey at cleverelephant.ca> wrote:
> Why can't I just this this:
>
> key1 = PG_GETARG_DATUM(0)
> key2 = PG_GETARG_DATUM(1)
>
> the datums are just uint, and they don't get turned into pointers
> until further down the line... I just tried changing my contains code
> to do this, and I got the same answer in the same amount of time.  Are
> the datum numbers reliable "object identifiers"?
>
> P.
>
> On Mon, Oct 6, 2008 at 10:53 AM, David Fuhry <dfuhry at acm.org> wrote:
>> ctid will work for that, but I believe it would have to be passed into the
>> function as a separate argument from the geometry, so API ugliness remains.
>



More information about the postgis-devel mailing list