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

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: is it a known issue or just a bug?
Дата
Msg-id
1644.1096917912@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
is it a known issue or just a bug? Hans-Jürgen Schönig <postgres@cybertec.at>
Re: is it a known issue or just a bug? Tom Lane <tgl@sss.pgh.pa.us>
Hans-Jürgen Schönig  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 по дате отправления
От: Reini Urban
Дата:
От: Tom Lane
Дата:
FAQ