Re: UPDATE crash in HEAD and 8.1

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: UPDATE crash in HEAD and 8.1
Date: 2006-06-20 18:09:13
Message-ID: 449839C9.2030602@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)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.

On 8.x (7.4 and 7.3 as well) it will update "1" row :). On 8.1 and HEAD
it crashes. This has been verified on 32bit, 64bit x86 and PPC.

> 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.

Sincerely,

Joshua D. Drake

>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2006-06-20 18:17:19 Re: Some small code-restructuring issues
Previous Message Wade Klaver 2006-06-20 18:03:55 Re: Initdb segfaults during "initializing pg_authid"