Search Postgresql Archives

quirk with update a from b

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 accident and put this in as a safety net?

Mike




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux