Re: is it a known issue or just a bug? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: is it a known issue or just a bug?
Date
Msg-id 1644.1096917912@sss.pgh.pa.us
Whole thread Raw
In response to Re: is it a known issue or just a bug?  (Hans-Jürgen Schönig <postgres@cybertec.at>)
Responses Re: is it a known issue or just a bug?
List pgsql-hackers
Hans-Jürgen Schönig <postgres@cybertec.at> writes:
> Josh Berkus wrote:
>> Frankly, I don't think there *is* any safe way to use volatile functions in 
>> subqueries -- I certainly avoid it, except now() and random() which as 
>> discussed are special cases.    Perhaps a WARNING is in order? 

> Personally I like Josh's idea. A warning would be a nice thing.

From the planner's perspective, it would have to warn about any volatile
function, which would probably be overly chatty --- remember that the
default marking for user-defined functions is "volatile".

This default may also be a good reason not to put in the anti-flattening
defenses I suggested before, because it would mean that even slight
sloppiness in the definition of a user function could cripple subquery
optimization.  I'm not sure that that's a strong argument, but it's
something to think about.

It'd be easy enough to put in the anti-flattening defenses (checks (1)
and (2) in my prior message) but I've got mixed emotions about whether
this is really a good thing to do.  Any opinions out there?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Reini Urban
Date:
Subject: Re: open item: tablespace handing in pg_dump/pg_restore
Next
From: Tom Lane
Date:
Subject: Re: open item: tablespace handing in pg_dump/pg_restore