Skip site navigation (1) Skip section navigation (2)

Re: Allow an alias for the target table in UPDATE/DELETE

From: Neil Conway <neilc(at)samurai(dot)com>
To: Atsushi Ogawa <atsushi(dot)ogawa(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Allow an alias for the target table in UPDATE/DELETE
Date: 2006-01-22 05:29:37
Message-ID: 1137907777.8798.7.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: 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



In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2006-01-22 05:48:06
Subject: Re: Allow an alias for the target table in UPDATE/DELETE
Previous:From: Tom LaneDate: 2006-01-22 00:38:01
Subject: Re: postmaster/postgres merge for testing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group