Re: UPDATE crash in HEAD and 8.1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: UPDATE crash in HEAD and 8.1
Дата
Msg-id 24790.1150824974@sss.pgh.pa.us
обсуждение исходный текст
Ответ на UPDATE crash in HEAD and 8.1  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: UPDATE crash in HEAD and 8.1  (Andrew Dunstan <andrew@dunslane.net>)
Re: UPDATE crash in HEAD and 8.1  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: UPDATE crash in HEAD and 8.1  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> update pk set id = max(id) + 2;

I'm fairly sure this query is illegal per spec.  There are ancient
discussions in the archives about whether aggregates in an UPDATE target
list can have a consistent interpretation or not.  We never found one,
but never got around to disallowing it either.  Maybe it's time.  If you
try it with something like sum() you don't get a crash, but you do get
rather bizarre behavior.

Having said that, this may well expose a bug in the MAX-optimization
code that has consequences for more useful queries.  I'll take a look
later today if no one beats me to it.
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Slightly bogus regression test for contrib/dblink
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Some small code-restructuring issues