Re: question on parsing postgres sql queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jerome Wagner <jerome(dot)wagner(at)laposte(dot)net>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: question on parsing postgres sql queries
Date: 2016-07-26 19:50:18
Message-ID: 8392.1469562618@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jerome Wagner <jerome(dot)wagner(at)laposte(dot)net> writes:
> 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 ?

Probably not. First, it is not uncommon for corner cases (such as
legacy syntaxes) to go unmentioned in the documentation. Second, the
implementation is often encrusted with details we'd just as soon not
expose to users. An example here is the need to be very specific in
the Bison grammar about whether extra parens in a "foo IN ((SELECT ...))"
construct belong to the SELECT or the IN.

It might be nice to have some sort of tool that could check compatibility
of the doc synopses with the actual grammar. But I doubt that trying to
auto-generate either one from the other would be a win.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-07-26 19:52:03 Re: question on parsing postgres sql queries
Previous Message Matthew Musgrove 2016-07-26 19:40:18 Re: Weirdness with the stats collector process