Re: question on parsing postgres sql queries - Mailing list pgsql-general

From Tom Lane
Subject Re: question on parsing postgres sql queries
Date
Msg-id 8392.1469562618@sss.pgh.pa.us
Whole thread Raw
In response to question on parsing postgres sql queries  (Jerome Wagner <jerome.wagner@laposte.net>)
List pgsql-general
Jerome Wagner <jerome.wagner@laposte.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


pgsql-general by date:

Previous
From: Matthew Musgrove
Date:
Subject: Re: Weirdness with the stats collector process
Next
From: "David G. Johnston"
Date:
Subject: Re: question on parsing postgres sql queries