case-sensitivity inconsistency in quoted column aliases in FROM subselects - Mailing list pgsql-bugs

From Mike Hoolehan
Subject case-sensitivity inconsistency in quoted column aliases in FROM subselects
Date
Msg-id 20020109114245.A21074@sycamorehq.com
Whole thread Raw
Responses Re: case-sensitivity inconsistency in quoted column aliases  (Peter Eisentraut <peter_e@gmx.net>)
Re: case-sensitivity inconsistency in quoted column aliases in FROM subselects  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: case-sensitivity inconsistency in quoted column aliases  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name        :   Mike Hoolehan
Your email address    : mike@sycamorehq.com


System Configuration
---------------------
  Architecture (example: Intel Pentium)      :  Intel Pentium

  Operating System (example: Linux 2.0.26 ELF)     :  RH 7.2, Kernel 2.4.9-13

  PostgreSQL version (example: PostgreSQL-7.1.3):   PostgreSQL-7.1.3

  Compiler used (example:  gcc 2.95.2)        : gcc 2.96 (rpm version)


Please enter a FULL description of your problem:
------------------------------------------------
if a quoted column alias in a FROM clause sub-select contains upper-case
chars, then that column cannot be later referenced without using quotes




Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
SELECT * FROM (SELECT col1 as "Foo" from table1) AS innerQuery
  WHERE Foo = 'whatever';
results in
"ERROR:  Attribute 'foo' not found"
no matter what capitalization is used for "Foo" in the where clause
(i.e. foo='whatever', FOO='whatever', etc).
I assume this is a bug, since if the column is aliases as "foo" (with
quotes, all lowercase), then the column can later be referenced
without quotes with case-insensitivity.



If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

pgsql-bugs by date:

Previous
From: Tim Nelson
Date:
Subject: Re: ecpg "aborts" on structure reference
Next
From: Bruno Wolff III
Date:
Subject: 'natural join' and 'join ... using' giving different results