pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Davor J. <DavorJ@live.com>
To: pgsql-sql@postgresql.org
Subject: Re: Well-formed SQL check in postgres?
Date: Fri, 9 Jul 2010 09:52:10 +0200
Message-ID: <i16khd$2g8f$1@news.hub.org> (raw)
References: <hu8ang$1isi$1@news.hub.org>

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
> 





Message-ID: <i16khd$2g8f$1@news.hub.org>
Permalink:  ../i16khd$2g8f$1@news.hub.org/
Also on:    postgresql.org/message-id/i16khd$2g8f$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: DavorJ@live.com
  Subject: Re: Well-formed SQL check in postgres?
  In-Reply-To: <i16khd$2g8f$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox