Skip site navigation (1) Skip section navigation (2)

BUG #5850: UPDATE statement fails when using aliases

From: "Joshua Farray" <farray(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5850: UPDATE statement fails when using aliases
Date: 2011-01-26 18:05:40
Message-ID: 201101261805.p0QI5eWP016518@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5850
Logged by:          Joshua Farray
Email address:      farray(at)gmail(dot)com
PostgreSQL version: 9.0.2
Operating system:   Win7 x64
Description:        UPDATE statement fails when using aliases
Details: 

Make a table:
> CREATE TABLE foos
> (
>   foo_id serial,
>   foo_text varchar(255)
> );

Update the table using an alias:
> UPDATE foos AS t
> SET t.foo_text = '';

Expected output:
> UPDATE 0

Actual output:
> ERROR:  column "t" of relation "foos" does not exist
> LINE 2: SET t.foo_text = '';
>             ^

Responses

pgsql-bugs by date

Next:From: hubert depesz lubaczewskiDate: 2011-01-26 18:26:45
Subject: Re: BUG #5850: UPDATE statement fails when using aliases
Previous:From: Tom LaneDate: 2011-01-26 17:21:52
Subject: Re: BUG #5849: Stats Collector Frozen - Autovacuum Not Working Anymore

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group