[postgis-devel] ST_Equals, immutable strict

Paragon Corporation lr at pcorp.us
Tue Aug 31 16:15:38 PDT 2010


Sandro,

I don't think it’s a bug in PostgreSQL.

Having STRICT vs. NON-STRICT still matters.

It is just that with STRICT the planner has to be guaranteed that for a
given query the answer returned by the function would be the same answer as
you get with inlining the function.

So if it concludes the content of your function is NON-STRICT, but you mark
it as STRICT -- it can't blindly inline it.  Since the inlined version could
return a different answer from your intended.

E.g.

CREATE OR REPLACE FUNCTION fn_something(param_doesnotmatter boolean) RETURNS
boolean AS
$$ SELECT true;$$
LANGUAGE sql STRICT;

SELECT fn_something(NULL);


This  returns NULL when given NULL input.  Which is different from what you
would get if you simply inlined the function.





-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Nicklas
Avén
Sent: Tuesday, August 31, 2010 2:05 PM
To: PostGIS Development Discussion
Subject: Re: [postgis-devel] ST_Equals, immutable strict

I commited
 
1.5 r5876
trunk 5877

if there is a better solution we should change in many places anyway

/Nicklas



On Tue, 2010-08-31 at 18:56 +0200, strk wrote:
> On Tue, Aug 31, 2010 at 12:47:30PM -0400, Paragon Corporation wrote:
> > Guys,
> > 
> > We had this discussion before.  Its all documented in this ticket.
> > 
> > http://trac.osgeo.org/postgis/ticket/536
> 
> Interesting discussion indeed.
> I've to say though, that I still don't see how that's not a pgsql bug. 
> If PostgreSQL considers presence of AND as a sign of a function not 
> being STRICT, then why presence or absence of STRICT changes 
> anything..
> 
> Did the thing ever got to pgsql-hackers for broader analisys ?
> 
> --strk;
> 
>   ()   Free GIS & Flash consultant/developer
>   /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
> 


_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel





More information about the postgis-devel mailing list