Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqLWK-00012v-CZ for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 14:11:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aqLWJ-0002Np-Vb for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 14:11:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqLWH-0002G9-EP for pgsql-hackers@postgresql.org; Wed, 13 Apr 2016 14:11:49 +0000 Received: from hermes.doblenet.net ([213.27.130.15]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqLWE-0000MI-Sr for pgsql-hackers@postgresql.org; Wed, 13 Apr 2016 14:11:49 +0000 Received: from vortex.hq.g4ii.com (hq.g4ii.com [88.26.239.182]) by hermes.doblenet.net (Postfix) with ESMTPSA id 3qlQhx1K6dz1j for ; Wed, 13 Apr 2016 16:11:45 +0200 (CEST) Subject: Re: Parser extensions (maybe for 10?) To: pgsql-hackers@postgresql.org References: <570C7B5A.9070309@gmail.com> From: =?UTF-8?B?Sm9zw6kgTHVpcyBUYWxsw7Nu?= Message-ID: <570E53A1.2000405@adv-solutions.net> Date: Wed, 13 Apr 2016 16:11:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------090205070406000103030804" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------090205070406000103030804 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 04/12/2016 06:45 AM, Craig Ringer wrote: > On 12 April 2016 at 12:36, Arcadiy Ivanov > 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. > FWIW, I have previously sketched a "syntax rewriter" of sorts: a simple filter which is applied to input before the lexer even sees it. Quite some "syntax magic" can be achieved by allowing an extension to *hook* into this functionality in order to do some rewriting; If turning one statement into several (multi-statement) is also allowed quite some serious emulation could be achieved. I can certainly prepare a small patch for the first commitfest of 9.7 if this sounds viable. Thanks, / J.L. --------------090205070406000103030804 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 04/12/2016 06:45 AM, Craig Ringer wrote:
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.

FWIW, I have previously sketched a "syntax rewriter" of sorts: a simple filter which is applied to input before the lexer even sees it.
Quite some "syntax magic" can be achieved by allowing an extension to *hook* into this functionality in order to do some rewriting; If turning one statement into several (multi-statement) is also allowed quite some serious emulation could be achieved.

I can certainly prepare a small patch for the first commitfest of 9.7 if this sounds viable.



Thanks,

    / J.L.

--------------090205070406000103030804--