Re: HINTing on UPDATE foo SET foo.bar = ..;

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: "pgsql-hackers >> PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HINTing on UPDATE foo SET foo.bar = ..;
Date: 2014-11-22 11:58:28
Message-ID: 54707A64.6060500@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-11-22 05:11, Peter Geoghegan wrote:
> On Fri, Nov 21, 2014 at 7:49 PM, Marko Tiikkaja <marko(at)joh(dot)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 Content-Type Size
update_qlf_hint.v2.patch text/plain 1.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message hubert depesz lubaczewski 2014-11-22 14:12:31 Re: How to use brin indexes?
Previous Message Pavel Stehule 2014-11-22 11:30:23 Re: some ideas from users