Re: How to evaluate if a query is correct? - Mailing list pgsql-general

From David Johnston
Subject Re: How to evaluate if a query is correct?
Date
Msg-id 1379603228534-5771624.post@n5.nabble.com
Whole thread Raw
In response to Re: How to evaluate if a query is correct?  (Rob Sargentg <robjsargent@gmail.com>)
List pgsql-general
lup wrote
> On 09/19/2013 12:13 AM, Juan Daniel Santana Rodés wrote:
>> Hi my friends...
>> I wrote in the last post a question similiar to this. But in this post
>> I clarify better the previous question.
>> I need know how to evaluated if a query is correct without execute it.
>> When I say if a query is correct, is that if I run the query, it did
>> not throw an exception.
>> For example...
>
> Is this an academic exercise or are you actually planning on checking
> sql then executing it if it's ok (according to your function).  I love
> plpgsql but I don't think it's the best option for, just to get started,
> parsing the incoming sql text - that would be one nasty regexp :)

There isn't a need to parse the text; the internal parser will do that for
you - you just need to make sure that the executor never gets ahold of the
resultant execution plan.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/How-to-evaluate-if-a-query-is-correct-tp5771568p5771624.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: How to evaluate if a query is correct?
Next
From: Dave Cramer
Date:
Subject: Re: reading cvs logs with pgadmin queries