Re: PostgreSQL vs SQL Standard

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL vs SQL Standard
Date: 2018-06-10 11:49:09
Message-ID: 8736xuvpnv.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2018-06-10 11:53:58 Re: PostgreSQL vs SQL Standard
Previous Message Michael Paquier 2018-06-10 10:45:04 pgsql: Fix and document lock handling for in-memory replication slot da