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
arca...@gmail.com | @arcivanov | https://ivanov.biz
https://github.com/arcivanov

Reply via email to