Re: quirk with update a from b

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mike G(dot)" <mike(at)thegodshalls(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: quirk with update a from b
Date: 2006-03-22 21:19:45
Message-ID: 19858.1143062385@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Mike G." <mike(at)thegodshalls(dot)com> writes:
> UPDATE bb
> SET bb.b_col1 = aa.a_col1
> FROM aa
> WHERE bb.b_col1 <> aa.a_col1;

> Error: column "bb" of relation "bb" does not exist.

> Maybe in a future version the alias can be allowed?

No. It's contrary to SQL spec, and if we allowed it we'd have an
ambiguity: are you assigning to field b_col1 of bb, or assigning
to field b_col1 of a composite-type field named bb in table bb?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2006-03-22 21:25:52 Re: question about the admin contrib module and binary
Previous Message Alejandro Michelin Salomon 2006-03-22 21:19:32 RES: Advantages of PostgreSQL over MySQL 5.0