Re: Hook for extensible parsing. - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Hook for extensible parsing.
Date
Msg-id 20210915195506.bse4pzi2x5atxzzw@alap3.anarazel.de
Whole thread Raw
In response to Re: Hook for extensible parsing.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Hook for extensible parsing.  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Re: Hook for extensible parsing.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2021-09-15 12:57:00 -0400, Tom Lane wrote:
> That's not what the patch actually does, though.  It only replaces
> the grammar, not semantic analysis.  So you couldn't associate the
> (+)-decorated WHERE clause with the appropriate join.  (And no,
> I will not accept that it's okay to perform catalog lookups in
> the grammar to get around that.  See comment at the head of gram.y.)

> In general, I'm having a hard time believing that anything very
> interesting can be done at only the grammar level without changing
> the parse analysis phase.  That's not unrelated to the restriction
> that the grammar can't do catalog accesses.  Maybe with some fundamental
> restructuring, we could get around that issue ... but this patch isn't
> doing any fundamental restructuring, it's just putting a hook where it's
> easy to do so.  We've often found that such hooks aren't as useful as
> they initially seem.

Agreed - it doesn't make sense to me to have a hook that only replaces raw
parsing, without also hooking into parse-analysis. ISTM that the least a
patchset going for a parser hook would have to do is to do sufficient
restructuring so that one could hook together into both raw parsing and
analysis. It could still be two callbacks, but perhaps we'd ensure that
they're both set.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: pg_upgrade test for binary compatibility of core data types
Next
From: Justin Pryzby
Date:
Subject: mem context is not reset between extended stats