Re: Missing docs on AT TIME ZONE precedence?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Shay Rojansky <roji(at)roji(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing docs on AT TIME ZONE precedence?
Date: 2023-11-28 13:26:52
Message-ID: 202311281326.ef2hacmpf67l@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-Nov-27, Tom Lane wrote:

> 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.

Ooh, this is very useful, thank you.

> After a bit of fooling around I found a patch that seems to meet
> that criterion; attached.

It looks good and passes tests, including the ecpg ones.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Entristecido, Wutra (canción de Las Barreras)
echa a Freyr a rodar
y a nosotros al mar"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2023-11-28 13:58:01 RE: [PoC] pg_upgrade: allow to upgrade publisher node
Previous Message Heikki Linnakangas 2023-11-28 13:06:06 Re: Streaming I/O, vectored I/O (WIP)