Re: How to know if a query is semantically correct without execute it? - Mailing list pgsql-general

From David Johnston
Subject Re: How to know if a query is semantically correct without execute it?
Date
Msg-id 1379565794177-5771556.post@n5.nabble.com
Whole thread Raw
In response to How to know if a query is semantically correct without execute it?  (Juan Daniel Santana Rodes <jdsantana@estudiantes.uci.cu>)
List pgsql-general
Juan Daniel Santana Rodés wrote
> Hi...
> I am programming a procedure in plpgsql language and it must return a
> boolean response.
> The procedure must return TRUE if the query is semantically correct and if
> not correct, return FALSE.
> This must be done without running the query.
> Greetings to all, thanks in advance.

You can confirm syntax (in theory, using explain) but not semantics.  The
later basically means that the query does what it's author intended.  Any
two queries with desired identical semantics must give the same output given
identical input - though the syntax of the two queries can differ.

You probably meant syntactically but since both terms have meaning in this
context picking the wrong word is confusing to others.

I'm not sure how safe doing so would be...or where limitations may exist -
i.e., some queries may not be able to be evaluated in this way.

David J.




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


pgsql-general by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Query - CPU issue
Next
From: Jayadevan
Date:
Subject: Re: Query - CPU issue