Re: Why the "UPDATE tab SET tab.col" is invalid? - Mailing list pgsql-hackers

From Geoff Winkless
Subject Re: Why the "UPDATE tab SET tab.col" is invalid?
Date
Msg-id CAEzk6feA3rzwCNKA+u3jneqfW_kAMhBd4Hhb92we=BeC_-WQwQ@mail.gmail.com
Whole thread Raw
In response to Re: Why the "UPDATE tab SET tab.col" is invalid?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 7 April 2016 at 16:45, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Don't know which version of the SQL spec you're looking at,

It was the draft 95 version, cos (being text file) it's easiest to
read :). I'll learn my lesson next time and expand the 2008 one.

> but SQL:2008 has
>
> <update statement: searched> ::=
>   UPDATE <target table> [ [ AS ] <correlation name> ]
>       SET <set clause list>
>       [ WHERE <search condition> ]
[snip]
> The reason why SQL doesn't allow an optional correlation name, and
> probably never will, is the same as the reason why we don't, and probably
> never will: it introduces an ambiguity as to whether you meant a dotted
> set-clause target name to be a reference to a field of a composite column
> or just a noise-word reference to the table's correlation name.

I stand (comprehensively :) ) corrected, thanks for clarifying.

Geoff



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [CommitFest App] Feature request -- review e-mail additions
Next
From: Tom Lane
Date:
Subject: Re: Why the "UPDATE tab SET tab.col" is invalid?