syntax for updating an aliased table - Mailing list pgsql-general

From Andy Chambers
Subject syntax for updating an aliased table
Date
Msg-id BANLkTinGt=xtePJETKG7Yd=bDBbc07YEJA@mail.gmail.com
Whole thread Raw
Responses Re: syntax for updating an aliased table  (Rick Genter <rick.genter@gmail.com>)
Re: syntax for updating an aliased table  (Bosco Rama <postgres@boscorama.com>)
List pgsql-general
I'm confused about the correct syntax for updating an aliased table.  I want to update triple from triple_updates
where the data is different and tried to use the following....

update triple old
                           set
                              old.obln = new.obln,  old.ointv = new.ointv,  old.otime = new.otime,  old.oflt = new.oflt,  old.ostr = new.ostr,  old.oint = new.oint,  old.oda = new.oda,  old.uasid = new.uasid
                           from triple_update as new
                          where (old.s = new.s and
                                 old.g = new.g) and
                                ( old.obln <> new.obln or  old.ointv <> new.ointv or  old.otime <> new.otime or  old.oflt <> new.oflt or  old.ostr <> new.ostr or  old.oint <> new.oint or  old.oda <> new.oda or  old.uasid <> new.uasid)


...but postgres complains about not having column "old" in the triple table.  Putting an "as" between triple and old on the first line didn't make any difference.  If
I leave out the old alias, it complains about the columns being ambiguous.  How should the query above be changed to be syntactically correct?

Thanks,
Andy

pgsql-general by date:

Previous
From: Carlo Stonebanks
Date:
Subject: Re: Miidpoint between two long/lat points? (earthdistance?)
Next
From: Rick Genter
Date:
Subject: Re: syntax for updating an aliased table