Re: table alias for update - Mailing list pgsql-general

From Bosco Rama
Subject Re: table alias for update
Date
Msg-id 4F6ECA19.8030201@boscorama.com
Whole thread Raw
In response to table alias for update  (hamann.w@t-online.de)
List pgsql-general
hamann.w@t-online.de wrote:
>
> is there a way to use a table alias for the target table in an UPDATE query?
> I would like to avoid spelling out things like that in psql:
>
> update myverylongtablename set col1 = r.col1repl from repltable r
>  where myverylongtablename.id = r.id and myverylongtablename.col2 > 0

update myverylongtablename as xyz
    set col1 = ...
    where xyz.id = ...;

The 'as' is optional ... though easier to read IMO.

HTH

Bosco.

pgsql-general by date:

Previous
From: hamann.w@t-online.de
Date:
Subject: table alias for update
Next
From: Jasen Betts
Date:
Subject: Re: Help in Parsing PG log usings CSV format