On Fri, Nov 21, 2014 at 7:49 PM, Marko Tiikkaja <marko@joh.to> wrote:
> A common mistake is to try and qualify column references on the LHS of SET
> in UPDATE.
I think that this is a good idea, but as written the patch doesn't
handle aliases correctly:
postgres=# create table foo (val text);
CREATE TABLE
postgres=# update foo f set val = 'bar' where f.val != 'fd';
UPDATE 0
postgres=# update foo f set f.val = 'bar' where f.val != 'fd';
ERROR: 42703: column "f" of relation "foo" does not exist
LINE 1: update foo f set f.val = 'bar' where f.val != 'fd'; ^
LOCATION: transformUpdateStmt, analyze.c:2015
--
Peter Geoghegan