pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arcadiy Ivanov <arcadiy@gmail.com>
To: pgsql-hackers@postgresql.org
Subject: Parser extensions (maybe for 10?)
Date: Tue, 12 Apr 2016 00:36:42 -0400
Message-ID: <570C7B5A.9070309@gmail.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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

view thread (28+ messages)  latest in thread

Message-ID: <570C7B5A.9070309@gmail.com>
Permalink:  ../570C7B5A.9070309@gmail.com/
Also on:    postgresql.org/message-id/570C7B5A.9070309@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: arcadiy@gmail.com
  Subject: Re: Parser extensions (maybe for 10?)
  In-Reply-To: <570C7B5A.9070309@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox