From: James Robinson <jlrobins@socialserve.com>
To: pgsql-sql@postgresql.org
Subject: 8.4 versus 8.2 against nonexistent column "name" ...
Date: Wed, 17 Mar 2010 10:16:08 -0400
Message-ID: <8AB806D0-91F7-4D31-BB6E-690E4419C770@socialserve.com> (raw)
Can anyone shine a light on why 8.4 behaves surprisingly when being
queried for a bogus column "name", but only using qualified table/
column references.
Here's a sample script:
-----
create table foo
(
id int,
x int
);
insert into foo(id, x)
values
(1, 23),
(2, 43),
(4, 45);
-- Fails on both -- no column named 'name'
select name from foo;
-- Fails on 8.2, still no 'name' column, but 8.4 succeeds returning
whole rows.
select f.name from foo f;
----
On 8.2.11, both selects fail:
CREATE TABLE
INSERT 0 3
ERROR: column "name" does not exist
LINE 1: select name from foo;
^
ERROR: column f.name does not exist
LINE 1: select f.name from foo f;
^
On 8.4.2, the first select fails, but the second succeeds, returning
whole rows wrapped up like tuples:
CREATE TABLE
INSERT 0 3
ERROR: column "name" does not exist
LINE 1: select name from foo;
^
name
--------
(1,23)
(2,43)
(4,45)
(3 rows)
A quick skim through the 8.3. and 8.4. release notes found nothing
interesting related to 'name'.
Thanks!
----
James Robinson
Socialserve.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jlrobins@socialserve.com
Subject: Re: 8.4 versus 8.2 against nonexistent column "name" ...
In-Reply-To: <8AB806D0-91F7-4D31-BB6E-690E4419C770@socialserve.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox