Re: Well-formed SQL check in postgres?

From: "Davor J(dot)" <DavorJ(at)live(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Well-formed SQL check in postgres?
Date: 2010-07-09 07:52:10
Message-ID: i16khd$2g8f$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Two rrror codes are interesting for this:
42000 SYNTAX ERROR OR ACCESS RULE VIOLATION

42601 SYNTAX ERROR

"Davor J." <DavorJ(at)live(dot)com> wrote in message
news:hu8ang$1isi$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
> 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
>

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas 2010-07-10 07:57:23 How would I store little key-Nr to text lists?
Previous Message Thomas Kellerer 2010-07-08 22:08:37 Re: Cant execute the query