Re: HINTing on UPDATE foo SET foo.bar = ..; - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: HINTing on UPDATE foo SET foo.bar = ..;
Date
Msg-id 54707A64.6060500@joh.to
Whole thread Raw
In response to Re: HINTing on UPDATE foo SET foo.bar = ..;  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On 2014-11-22 05:11, Peter Geoghegan wrote:
> 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

Good point!  Changed in v2, attached.


.marko

Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: some ideas from users
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: How to use brin indexes?