question on parsing postgres sql queries

From: Jerome Wagner <jerome(dot)wagner(at)laposte(dot)net>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: question on parsing postgres sql queries
Date: 2016-07-26 19:20:53
Message-ID: CA+=V_fO57GU4xuDzRL1bpxw2W4q0EWX1mcjbLoN3H_FjU9XV4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I am doing some research on postgres sql query parsing.

I have found the https://github.com/lfittl/libpg_query project which
manages to re-use the native postgres server parser. For using this, you
need to accept an external dependency on a lib compiled out of the postgres
source.

I was wondering what people think of the conformance with regards to the
real parser of the documentations on
- https://www.postgresql.org/docs/current/static/sql-select.html
- https://www.postgresql.org/docs/current/static/sql-copy.html
... and more generally sgmls in
https://github.com/postgres/postgres/tree/master/doc/src/sgml/ref

Would it make sense to use these sgml synopsis as some kind of source of
truth, parse them, and automatically generate a parser for a specifc
language ?

This could enable the creation of parsers for different languages using
parser generators based on the synopsis.

I feel like the conformance level of the documentation is high and that the
sgml synopis seem to be nearly programmatically sufficient to create
parsers.

what do you think ?

Could the parser commiters share some lights on how the documentation
process interacts with the parser commits ?

Thanks,
Jerome

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Musgrove 2016-07-26 19:40:18 Re: Weirdness with the stats collector process
Previous Message Dev Kumkar 2016-07-26 18:45:47 Re: How to stop script executions