quirk with update a from b - Mailing list pgsql-general

From Mike G.
Subject quirk with update a from b
Date
Msg-id 20060322205606.GA1839@localhost.localdomain
Whole thread Raw
Responses Re: quirk with update a from b
List pgsql-general
CREATE TABLE aa
(
a_col1 text
);

CREATE TABLE bb
(
b_col1 text
);

This update works:
UPDATE bb
SET b_col1 = aa.a_col1
FROM aa
WHERE bb.b_col1 <> aa.a_col1;

This does not:
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.

postgres 8.1.2

Maybe in a future version the alias can be allowed? Perhaps someone wanted to avoid updating the wrong column on
accidentand put this in as a safety net? 

Mike



pgsql-general by date:

Previous
From: Guy Fraser
Date:
Subject: Re: Advantages of PostgreSQL over MySQL 5.0
Next
From: Tony Caduto
Date:
Subject: Re: question about the admin contrib module and binary