Incorrect column identifer using AS in SELECT statement on a VIEW.

From: Hayden James <hayden(dot)james(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Incorrect column identifer using AS in SELECT statement on a VIEW.
Date: 2005-11-23 07:20:07
Message-ID: f9cd33b40511222320w3c5761ceo8b6044cf1c48b79@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

If I create a normal table and a normal view that queries that table I get
incorrect results when I query the view using the AS alias in the select
statement. For example, if I create the following objects:

CREATE TABLE Test1( col1 VARCHAR(200) );
CREATE VIEW Test2 AS SELECT col1 FROM Test1 ORDER BY col1;

then I do a SELECT col1 AS something FROM Test2; The column identifier
comes back as "col1" instead of "something".

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Harald Armin Massa 2005-11-23 07:24:52 Re: strange disappearence of postgres file
Previous Message Tom Lane 2005-11-23 04:45:58 Re: BUG #2065: Problem with language conversion in pg_dump