Re: case-sensitivity inconsistency in quoted column aliases in FROM subselects

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: case-sensitivity inconsistency in quoted column aliases in FROM subselects
Дата
Msg-id 14499.1010605078@sss.pgh.pa.us
обсуждение исходный текст
Ответ на case-sensitivity inconsistency in quoted column aliases in FROM subselects  (Mike Hoolehan <mike@sycamorehq.com>)
Список pgsql-bugs
Mike Hoolehan <mike@sycamorehq.com> writes:
> 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.

This is not a bug, it's the expected behavior.  See the discussion of
identifier case sensitivity in the manual, eg
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: case-sensitivity inconsistency in quoted column aliases
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: case-sensitivity inconsistency in quoted column aliases