Re: [BUGS] Update using sub-select table in schema

2006-10-02 Thread Tom Lane
I wrote: > The comments for refnameRangeTblEntry indicate that at one time we > thought we saw support for our approach in the spec: Here is the discussion thread that settled on our current behavior: http://archives.postgresql.org/pgsql-hackers/2002-03/msg00403.php It looks like we followed Oracl

Re: [BUGS] Update using sub-select table in schema

2006-10-02 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > On Mon, 2006-10-02 at 11:38 -0400, Tom Lane wrote: >> Postgres treats "FROM temp.a" the same as "FROM temp.a AS a", > [Which AFAICS doesn't follow SQL:2003, since a reference to temp.a > should not be allowed following its redefinition as a.] I'm sorry, I

Re: [BUGS] Update using sub-select table in schema

2006-10-02 Thread Simon Riggs
On Mon, 2006-10-02 at 11:38 -0400, Tom Lane wrote: > Chris Dunlop <[EMAIL PROTECTED]> writes: > > I'm not sure if this is a bug or if it's displaying my ignorance > > of this corner of SQL... > > > update a set name = ( > > select name > > from temp.a > > where temp.a.id = a.id > > ) > > Po

Re: [BUGS] Update using sub-select table in schema

2006-10-02 Thread Tom Lane
Chris Dunlop <[EMAIL PROTECTED]> writes: > I'm not sure if this is a bug or if it's displaying my ignorance > of this corner of SQL... > update a set name = ( > select name > from temp.a > where temp.a.id = a.id > ) Postgres treats "FROM temp.a" the same as "FROM temp.a AS a", and then the

[BUGS] Update using sub-select table in schema

2006-10-02 Thread Chris Dunlop
G'day all, PG version: 8.1.4 (also 7.4.13) OS: Linux (debian/testing) In an update, using a sub-select from a table with the same name but in a different schema results in an error. The same thing works if you alias the sub-select table or if you qualify the schema of the update table. See scr