Re: underscore split to alias

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: underscore split to alias
Дата
Msg-id 10608.1273878520@sss.pgh.pa.us
обсуждение исходный текст
Ответ на underscore split to alias  ("Erik Rijkers" <er@xs4all.nl>)
Список pgsql-hackers
"Erik Rijkers" <er@xs4all.nl> writes:
> I am not sure this is a bug, but I was surprised by the following behaviour
> in HEAD and 8.4.4 (instances built today, 2010.05.14):

> Invalid (?) values like 123_456 are split before the underscore and interpreted as
> 123 as "456":

All versions of postgres will parse 123_456 as an integer (123)
immediately followed by an identifier (_456).  In the particular context
that this is all of a top-level SELECT item, the SQL spec requires that
we parse this as an integer and a column alias (with an implied AS).
We failed to do that before 8.4, but now honor the spec requirement
that AS can be omitted.  Personally I think that's one of the stupider,
more error-prone aspects of the spec's syntax, but nonetheless it's
required by spec ....
        regards, tom lane


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

Предыдущее
От: "Erik Rijkers"
Дата:
Сообщение: underscore split to alias
Следующее
От: Joseph Adams
Дата:
Сообщение: Re: JSON manipulation functions