Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bryn Llewellyn <bryn@xxxxxxxxxxxx> 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






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux