Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apq5g-0001Fa-NF for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2016 04:38:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1apq5g-00082b-8m for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2016 04:38:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1apq4L-0006ZR-7D for pgsql-hackers@postgresql.org; Tue, 12 Apr 2016 04:36:53 +0000 Received: from mail-qg0-x233.google.com ([2607:f8b0:400d:c04::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1apq4D-0004nn-Rs for pgsql-hackers@postgresql.org; Tue, 12 Apr 2016 04:36:52 +0000 Received: by mail-qg0-x233.google.com with SMTP id j35so6669363qge.0 for ; Mon, 11 Apr 2016 21:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version; bh=+1Auag8gPo1DCldD2Np+YruGSHyqkC8yLMfmfx5smko=; b=UsgaYNDl5q35YXeUHOiTKd6mtwNJ7zFAjQHje6VcxiQstmT2lWchTNsjzRnSWUHnJs bep4EkrzdL2wLfn8CmzwJcYmERlFojWHtlbXG5V4Xbk5cEoAhr+MeCryj0Jn+09/sQAX PcF0n8JENwWLD1shZ2cuvFcfdlttjBZTRh52zpOM3i25idBAG/0rS7booUOcr3ertD/c BnHxKLCbDNqSlt7R3zEoi5S2HGMJ5GYQMFRMBAxhaihBBCKmdWlNWv7/NVwgFhsyDrKD VFDsLjg4aM4Hx7WLtPxzAlWZpfeUDlNt7yv116l79x4H6Tu4Sm/5RkO8BTNKu7qJvVEr taKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=+1Auag8gPo1DCldD2Np+YruGSHyqkC8yLMfmfx5smko=; b=bDEaE4Dx7BVFPlZVjVqYNimtxF3n+HzGB1BRFIFciMfK65EiedyQ+LR1kF3vHLY4G9 VZ8h5woAUR11ku+SyvHQGfRi3EkpV5Uoob9o/U9HP6fBfzzygzctefwxbH18DID16YOr jtYzch8zKVuqc9hA7bK564q7CRWsbm8smIZpMiAKMgALsFbfF9bHGENrChtOBm2zfNPN vEjFqyWNtmLabQx43kbnlr8HPj93HOGxht7OJRgZMWX/fXKbMjvPIXbEZY5Airr2OfVy /UuoeH8CrrF6Uq9y+pgsbYZzc4x7zjehS2Hbz8/6gFtO/Ddc7mqaELx6mHstWjDpDnSQ sDfQ== X-Gm-Message-State: AOPr4FVubjAbS/U/hzuM4vk+KVbao+IYTB0PC/pmqz2swX1vysYJCFZlTP+2FuUyKBoV1g== X-Received: by 10.140.204.4 with SMTP id z4mr1349564qha.47.1460435804918; Mon, 11 Apr 2016 21:36:44 -0700 (PDT) Received: from [192.168.157.198] (c-98-229-10-142.hsd1.ma.comcast.net. [98.229.10.142]) by smtp.googlemail.com with ESMTPSA id j185sm4808161qke.40.2016.04.11.21.36.43 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2016 21:36:43 -0700 (PDT) To: pgsql-hackers@postgresql.org From: Arcadiy Ivanov Subject: Parser extensions (maybe for 10?) Message-ID: <570C7B5A.9070309@gmail.com> Date: Tue, 12 Apr 2016 00:36:42 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------070407070902090107030709" X-Pg-Spam-Score: -2.7 (--) 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. --------------070407070902090107030709 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I thought I'd float this idea and see if this gets any traction. Please forgive my ignorance if this has been discussed already. Currently the parser and lexer are fully fixed at compile-time and not amenable to the extensions - extensions are only capable of introducing functions etc. There is, however, an advantage to being able if not add or alter complete statements (which would be nice), but to at least augment portions of syntax for existing ones in some places. For example PGXL adds the following to CREATE TABLE statement: [ DISTRIBUTE BY { REPLICATION | ROUNDROBIN | { [HASH | MODULO ] ( column_name ) } } | DISTRIBUTED { { BY ( column_name ) } | { RANDOMLY } | DISTSTYLE { EVEN | KEY | ALL } DISTKEY ( column_name ) ] [ TO { GROUP groupname | NODE ( nodename [, ... ] ) } ] Compare: http://www.postgresql.org/docs/9.5/static/sql-createtable.html http://files.postgres-xl.org/documentation/sql-createtable.html 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. Cheers, -- Arcadiy Ivanov arcadiy@gmail.com | @arcivanov | https://ivanov.biz https://github.com/arcivanov --------------070407070902090107030709 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable I thought I'd float this idea and see if this gets any traction. Please forgive my ignorance if this has been discussed already.

Currently the parser and lexer are fully fixed at compile-time and not amenable to the extensions - extensions are only capable of introducing functions etc.

There is, however, an advantage to being able if not add or alter complete statements (which would be nice), but to at least augment portions of syntax for existing ones in some places.

For example PGXL adds the following to CREATE TABLE statement:

[
=C2=A0 DISTRIBUTE BY { REPLICATION | ROUNDROBIN | { [HASH | MODULO = ] ( column_name ) } } |
=C2=A0 DISTRIBUTED { { BY ( column_name ) } | { RANDOMLY } |
=C2=A0 DISTSTYLE { EVEN | KEY | ALL } DISTKEY ( column_name )
]
[ TO { GROUP groupname | NODE ( nodename [, ... ] ) } ]

Compare:

http://www.postgresql.org/docs/9.= 5/static/sql-createtable.html
http://files.postgres-xl.org/d= ocumentation/sql-createtable.html

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.

Cheers,
--=20
Arcadiy Ivanov
a=
rcadiy@gmail.com | @arcivanov | https://ivanov.biz
=
https://github.com/arcivanov
--------------070407070902090107030709--