Re: How to know if a query is semantically correct without execute it?

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to know if a query is semantically correct without execute it?
Date: 2013-09-19 04:43:14
Message-ID: 1379565794177-5771556.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jayadevan 2013-09-19 04:55:20 Re: Query - CPU issue
Previous Message Kevin Grittner 2013-09-19 04:03:11 Re: Query - CPU issue