Re: Allow an alias for the target table in UPDATE/DELETE - Mailing list pgsql-patches

From Neil Conway
Subject Re: Allow an alias for the target table in UPDATE/DELETE
Date
Msg-id 1137907777.8798.7.camel@localhost.localdomain
Whole thread Raw
In response to Re: Allow an alias for the target table in UPDATE/DELETE  (Atsushi Ogawa <atsushi.ogawa@gmail.com>)
Responses Re: Allow an alias for the target table in UPDATE/DELETE  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Allow an alias for the target table in UPDATE/DELETE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Sat, 2005-12-03 at 10:42 +0900, Atsushi Ogawa wrote:
> Thanks for comments. I modified the patch.

Patch applied to HEAD.

From looking at SQL2003, it seems to me that this syntax is actually
specified by the standard:

<update statement: searched> ::=
    UPDATE <target table> [ [ AS ] <correlation name> ]
    SET <set clause list>
    [ WHERE <search condition> ]

<delete statement: searched> ::=
    DELETE FROM <target table> [ [ AS ] <correlation name> ]
    [ WHERE <search condition> ]

I think we ought to support using the alias in the SET clause,
particularly as the standard allows for it (AFAIK).

-Neil



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: postmaster/postgres merge for testing
Next
From: Tom Lane
Date:
Subject: Re: Allow an alias for the target table in UPDATE/DELETE