>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
Tom> WRT 3.2 on select-list aliases, the postfix-operator issue is only
Tom> one of several reasons why we can't support that. There was some
Tom> more-detailed discussion about that awhile back,
I beat at the grammar a bit to see what it would take to fix it at least
to the extent of allowing a_expr ColId in a select list after removing
postfix ops. It looked like it was doable by making these keywords more
reserved (all of which are already reserved words per spec):
DOUBLE, DAY, FILTER, HOUR, MINUTE, MONTH, OVER, PRECISION, SECOND,
VARYING, WITHIN, WITHOUT, YEAR
(notice that ISNULL is not actually a problem since it's already a
type_func_name_keyword and thus not a legal ColId)
Example ambiguous inputs that would require these to be reserved:
SELECT double precision FROM ...
SELECT interval '1' second FROM ... -- also year,month,day,hour,minute
SELECT count(x) filter (...
SELECT percentile_cont(0.5) within group (...
SELECT x::character varying FROM ...
SELECT x::timestamp without time zone FROM ...
--
Andrew (irc:RhodiumToad)