public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andrew Dunstan <[email protected]>
To: Tom Lane <[email protected]>
To: Alvaro Herrera <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Shay Rojansky <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Missing docs on AT TIME ZONE precedence?
Date: Mon, 27 Nov 2023 16:09:10 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On 2023-11-27 Mo 15:34, Tom Lane wrote:
> Alvaro Herrera <[email protected]> writes:
>> (TBH I don't think the added comments really explain the problems fully.
>> That's most likely because I don't actually understand what the problems
>> are.)
> The actual problem is that nobody has applied a cluestick to the SQL
> committee about writing an unambiguous grammar :-(. But I digress.
>
> I don't like the existing coding for more reasons than just
> underdocumentation. Global assignment of precedence is a really,
> really dangerous tool for solving ambiguous-grammar problems, because
> it can mask problems unrelated to the one you think you are solving:
> basically, it eliminates bison's complaints about grammar ambiguities
> related to the token you mark. (Commits 12b716457 and 28a61fc6c are
> relevant here.) Attaching precedence to individual productions is
> far safer, because it won't have any effect that extends beyond that
> production. You still need a precedence attached to the lookahead
> token; but I think we should try very hard to not assign a precedence
> different from IDENT's to any unreserved keywords.
>
> After a bit of fooling around I found a patch that seems to meet
> that criterion; attached.
>
>
Looks good. Perhaps the comments above the UNBOUNDED precedence setting
(esp. the first paragraph) need strengthening, with a stern injunction
to avoid different precedence for non-reserved keywords if at all possible.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
view thread (5+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Missing docs on AT TIME ZONE precedence?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox