Re: Parser extensions (maybe for 10?) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Parser extensions (maybe for 10?)
Date
Msg-id 6998.1460440319@sss.pgh.pa.us
Whole thread Raw
In response to Re: Parser extensions (maybe for 10?)  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Parser extensions (maybe for 10?)  (Craig Ringer <craig@2ndquadrant.com>)
Re: Parser extensions (maybe for 10?)  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> The other area where there's room for extension without throwing out the
> whole thing and rebuilding is handling of new top-level statements. We can
> probably dispatch the statement text to a sub-parser provided by an
> extension that registers interest in that statement name when we attempt to
> parse it and fail. Even then I'm pretty sure it won't be possible to do so
> while still allowing multi-statements. I wish we didn't support
> multi-statements, but we're fairly stuck with them.

Well, as I said, I've been there and done that.  Things get sticky
when you notice that those "new top-level statements" would like to
contain sub-clauses (e.g. arithmetic expressions) that should be defined
by the core grammar.  And maybe the extension would also like to
define additions to the expression grammar, requiring a recursive
callback into the extension.  It gets very messy very fast.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Parser extensions (maybe for 10?)
Next
From: Amit Kapila
Date:
Subject: Re: Move PinBuffer and UnpinBuffer to atomics