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

From Craig Ringer
Subject Re: Parser extensions (maybe for 10?)
Date
Msg-id CAMsr+YFHfJ7YKcRCUP_BdJZ+SHwoF9CdEvk8b-opVRDrHXf7uw@mail.gmail.com
Whole thread Raw
In response to Parser extensions (maybe for 10?)  (Arcadiy Ivanov <arcadiy@gmail.com>)
Responses Re: Parser extensions (maybe for 10?)  (José Luis Tallón <jltallon@adv-solutions.net>)
List pgsql-hackers
On 12 April 2016 at 12:36, Arcadiy Ivanov <arcadiy@gmail.com> wrote:
 

Is there any interest and/or tips to allow a pluggable parser or at least allow some syntactical pluggability by extensions?
I think this may allow some projects to move towards becoming an extension as opposed to forking the project entirely.

How would you go about it?

PostgreSQL uses a parser generator that produces C code as its output. Extensions can't just patch the grammar and regenerate the parser. So even if it were desirable, a fully extensible parser would require a total rewrite of the parser/lexer.

That doesn't mean there can't be extension points for SQL syntax, they just need to be planned carefully, located where they won't create parsing ambiguities, and somewhat limited. 

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Arcadiy Ivanov
Date:
Subject: Parser extensions (maybe for 10?)
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: Re: Parser extensions (maybe for 10?)