Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
On 10 December 2013 22:57, Peter Kroon plakr...@gmail.com wrote: Why do you want to do that? I want to validate the SQL syntax and preferably in the browser using some kind of linter. You can always run it inside transaction and rollback at the end. Sounds dangerous and will make the server

Re: [GENERAL] validate synatax

2013-12-11 Thread Michael Paquier
On Wed, Dec 11, 2013 at 9:11 PM, Szymon Guz mabew...@gmail.com wrote: This would simply be as complicated as the database itself, and I'm sure that if I had to implement such a validator, I would just finish with embedding the query in a transaction rolled back at the end, and run it on some

Re: [GENERAL] validate synatax

2013-12-11 Thread Jov
you can use the transition. eg: begin; creat table(...); catch error if the statement not validated. rollback; jov 在 2013-12-11 上午5:43,Peter Kroon plakr...@gmail.com写道: Hi, How can I validate any query on PostgreSQL without executing the sql. I was able with EXPLAIN to find some errors.

Re: [GENERAL] validate synatax

2013-12-11 Thread Peter Kroon
Perhaps creating a temporary table would be more efficient. Then the rollback isn't necessary. 2013/12/11 Jov zhao6...@gmail.com you can use the transition. eg: begin; creat table(...); catch error if the statement not validated. rollback; jov 在 2013-12-11 上午5:43,Peter Kroon

Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
On 11 December 2013 15:35, Peter Kroon plakr...@gmail.com wrote: Perhaps creating a temporary table would be more efficient. Then the rollback isn't necessary. Yep, but only if you're sure that you don't have queries which change other parts of the database, including calling procedures

Re: [GENERAL] validate synatax

2013-12-10 Thread Szymon Guz
On 10 December 2013 22:40, Peter Kroon plakr...@gmail.com wrote: Hi, How can I validate any query on PostgreSQL without executing the sql. I was able with EXPLAIN to find some errors. However this only worked with a SELECT statement. When i tried to create a TABLE it would not run. I do not

Re: [GENERAL] validate synatax

2013-12-10 Thread Peter Kroon
Why do you want to do that? I want to validate the SQL syntax and preferably in the browser using some kind of linter. You can always run it inside transaction and rollback at the end. Sounds dangerous and will make the server very active because it is executing the SQL. Yes, the SQL should be

Re: [GENERAL] validate synatax

2013-12-10 Thread Jerry Sievers
Peter Kroon plakr...@gmail.com writes: Hi, How can I validate any query on PostgreSQL without executing the sql. I was able with EXPLAIN to find some errors. However this only worked with a SELECT statement. When i tried to create a TABLE it would not run. I do not wish to install external