Re: 8.4 versus 8.2 against nonexistent column "name" ...

From: Osvaldo Kussama <osvaldo(dot)kussama(at)gmail(dot)com>
To: James Robinson <jlrobins(at)socialserve(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: 8.4 versus 8.2 against nonexistent column "name" ...
Date: 2010-03-17 14:48:06
Message-ID: 690707f61003170748q3e5a38cfvee438e6efd871726@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

2010/3/17 James Robinson <jlrobins(at)socialserve(dot)com>:
> 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'.
>

See this thread:
http://archives.postgresql.org/pgsql-general/2010-02/msg01035.php

Osvaldo

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ignacio Balcarce 2010-03-17 14:52:53 MSSQL to PostgreSQL - Issue trying to generate unique ID using actual date
Previous Message Tom Lane 2010-03-17 14:21:32 Re: select points of polygons