Re: Well-formed SQL check in postgres? - Mailing list pgsql-sql

From Davor J.
Subject Re: Well-formed SQL check in postgres?
Date
Msg-id i16khd$2g8f$1@news.hub.org
Whole thread Raw
List pgsql-sql
Two rrror codes are interesting for this:
42000 SYNTAX ERROR OR ACCESS RULE VIOLATION

42601 SYNTAX ERROR


"Davor J." <DavorJ@live.com> wrote in message 
news:hu8ang$1isi$1@news.hub.org...
> Has anyone a suggestion on how to check whether a SQL SELECT query in 
> postgres is well-formed (like wff). The query should not be executed (!), 
> only checked for well-formedness.
>
> What I was thinking off is appending EXPLAIN to the query. EXPLAIN doesn't 
> execute it, but just runs it through the planner. Then I can read whether 
> there was any error or not.
>
> Is there a better way or is this the way to go?
>
> Thanks,
> Davor
> 




pgsql-sql by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Cant execute the query
Next
From: Andreas
Date:
Subject: How would I store little key-Nr to text lists?