Re: is it a known issue or just a bug?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: is it a known issue or just a bug?
Date: 2004-10-04 19:25:12
Message-ID: 1644.1096917912@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?B?SGFucy1Kw7xyZ2VuIFNjaMO2bmln?= <postgres(at)cybertec(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-10-04 19:26:52 Re: Contrib/earthdistance missing from cvsweb.
Previous Message Reini Urban 2004-10-04 19:20:57 Re: open item: tablespace handing in pg_dump/pg_restore