Re: [PATCH] Add --syntax to postgres for SQL syntax checking
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Josef Šimánek <josef.simanek@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>, "David G. Johnston" <david.g.johnston@gmail.com>,
Tom Lane <tgl@sss.pgh.pa.us>, Laurenz Albe <laurenz.albe@cybertec.at>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-05-15T19:05:15Z
Lists: pgsql-hackers
On Wed, May 15, 2024 at 2:12 PM Josef Šimánek <josef.simanek@gmail.com> wrote: > I'm totally OK to mark this as rejected and indeed 45 lines were just > minimal patch to create PoC (I have coded this during last PGConf.eu > lunch break) and mainly to start discussion. Thanks for understanding. > I'm not sure everyone in this thread understands the reason for this > patch, which is clearly my fault, since I have failed to explain. Main > idea is to make a tool to validate query can be parsed, that's all. > Similar to running "EXPLAIN query", but not caring about the result > and not caring about the DB structure (ignoring missing tables, ...), > just checking it was successfully executed. This definitely belongs to > the server side and not to the client side, it is just a tool to > validate that for this running PostgreSQL backend it is a "parseable" > query. I don't think it's at all obvious that this belongs on the server side rather than the client side. I think it could be done in either place, or both. I just think we don't have the infrastructure to do it cleanly, at present. -- Robert Haas EDB: http://www.enterprisedb.com