Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
On 11 December 2013 15:35, Peter Kroon 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 which could change

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 > 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" 写道: > > Hi, >> >>

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" 写道: > 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

Re: [GENERAL] validate synatax

2013-12-11 Thread Michael Paquier
On Wed, Dec 11, 2013 at 9:11 PM, Szymon Guz 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 test database. S

Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
On 10 December 2013 22:57, Peter Kroon 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 very activ

Re: [GENERAL] validate synatax

2013-12-10 Thread Jerry Sievers
Peter Kroon 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 packages. Pr

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 Szymon Guz
On 10 December 2013 22:40, Peter Kroon 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 wish to inst

[GENERAL] validate synatax

2013-12-10 Thread Peter Kroon
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 packages. Preferably use only default present