Re: Surprisingly forgiving behavior when a case expression is terminated with "end case"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Surprisingly forgiving behavior when a case expression is terminated with "end case"
Дата
Msg-id 370703.1660159073@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Surprisingly forgiving behavior when a case expression is terminated with "end case"  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: Surprisingly forgiving behavior when a case expression is terminated with "end case"  (Bryn Llewellyn <bryn@yugabyte.com>)
Список pgsql-general
Bryn Llewellyn <bryn@yugabyte.com> writes:
> Moreover CASE is a reserved word—as a "create table case(…)" attempt shows. Yet CASE is tolerated (using PG 14.4)
here:

> select 1 as case;

> In fact, any reserved word that I try (like IF, THEN, and so on) is accepted as an alias. This seems to me to be
wrong.What do you (all) think? 

I think we've spent a great deal of blood, sweat, and tears
making that so, or as nearly so as we could.  We will in
fact take any keyword after "AS", and in recent versions many
non-reserved keywords will work that way without "AS".

(Mind you, I think the SQL spec made a serious design error
in allowing "AS" to be optional.  But we have to live with that
as best we can.)

            regards, tom lane



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

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Surprisingly forgiving behavior when a case expression is terminated with "end case"
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Surprisingly forgiving behavior when a case expression is terminated with "end case"