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

From CR Lender
Subject Re: How to know if a query is semantically correct without execute it?
Date
Msg-id 523A5143.6010105@gmail.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
On 2013-09-19 02:01, Juan Daniel Santana Rodes wrote:
> 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.

You could use EXPLAIN instead of running the actual query, catching the
eventual errors and returning TRUE or FALSE depending on the outcome.
I'm not sure what you mean by "semantically correct", but in addition to
simple syntax errors, non-existent relations, columns, functions, etc,
would also be caught.

regards,
CRL


pgsql-general by date:

Previous
From: Juan Daniel Santana Rodes
Date:
Subject: How to know if a query is semantically correct without execute it?
Next
From: Jayadevan
Date:
Subject: Re: Query - CPU issue