Re: Improper processing of random values in sub-queries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Improper processing of random values in sub-queries
Дата
Msg-id 2071.1089428535@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Improper processing of random values in sub-queries  (David Newall <davidn-postgres@rebel.net.au>)
Ответы Re: Improper processing of random values in sub-queries  (davidn-postgres@rebel.net.au)
Список pgsql-bugs
David Newall <davidn-postgres@rebel.net.au> writes:
> NOW CONSIDER the following query, executed using psql:

> SELECT i, j from (
>   SELECT i, ((i + 18 * random())::integer % 20 + 1) AS j FROM data
> ) foo WHERE j = 15;

Hmph.  Evidently the planner should refuse to flatten subselects that
have volatile functions in their output list (and perhaps anywhere
else??).  This will probably make some people unhappy, but I see no
other fix.

I assume though that this is a made-up example and is not the case
that's really troubling you.  What is the actual problem you are looking
at?

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1188: evaluation order of select seems to be wrong
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fwd: postgresql-autodoc - missinterprets "version"