Re: [GENERAL] question on parsing postgres sql queries

2016-07-27 Thread Alvaro Herrera
Kevin Grittner wrote: > On the other hand, try connecting to a database with > psql and typing: > > \h create index > > ... (or any other command name). The help you get there is fished > out of the docs. BTW I noticed a few days ago that we don't have a "where BLAH can be one of" section for

Re: [GENERAL] question on parsing postgres sql queries

2016-07-27 Thread Kevin Grittner
On Tue, Jul 26, 2016 at 4:20 AM, Jerome Wagner wrote: > I am doing some research on postgres sql query parsing. > I was wondering what people think of the conformance with regards to the > real parser of the documentations on > -

Re: [GENERAL] question on parsing postgres sql queries

2016-07-27 Thread Jerome Wagner
> What problem are you trying to solve here?​ to whit not everything that can be parsed is documented - usually intentionally. I am tyring to see whether we could use the documentation as a kind of formal specification of the language but I understand that the devil is in the details and that

Re: [GENERAL] question on parsing postgres sql queries

2016-07-26 Thread David G. Johnston
On Tue, Jul 26, 2016 at 3:20 PM, Jerome Wagner wrote: > > 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 ? > ​What problem are you trying to solve here?​ to

Re: [GENERAL] question on parsing postgres sql queries

2016-07-26 Thread Tom Lane
Jerome Wagner 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