Last call for objections: SELECT alias without AS for IDENTs only?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Cc: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, Gregory Stark <stark(at)enterprisedb(dot)com>
Subject: Last call for objections: SELECT alias without AS for IDENTs only?
Date: 2008-02-15 17:38:41
Message-ID: 6100.1203097121@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Is anyone opposed to applying the patch shown here
http://archives.postgresql.org/pgsql-hackers/2008-02/msg00434.php
(plus appropriate docs changes etc)? This allows AS to be omitted
in a SELECT output-column alias clause, but only if the desired
alias name lexes as an IDENT, that is, it's not any known keyword
(reserved or otherwise). It would be nicer if it allowed any
unreserved keyword too; but per discussion, the only way that could
happen is if we made some currently unreserved keywords reserved,
which does not seem like a net improvement.

The documentation would probably have to say something like "You
can omit AS only if the desired alias name is not any known
keyword (see Appendix C). For protection against possible future
keyword additions, it is recommended that you always either use AS
or double-quote the alias name."

On the whole this form of the patch seems like a reasonable compromise
--- it doesn't lose any existing functionality, it doesn't take much
work, and it should at least dampen complaints about our lack of spec
compliance on this point.

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-02-15 17:44:05 Re: wishlist for 8.4
Previous Message Christian Robottom Reis 2008-02-15 16:58:52 CVS repository invalid revision