Re: Well-formed SQL check in postgres?
Re: Well-formed SQL check in postgres?
От:
"Davor J." <DavorJ@live.com>
Дата:
Two rrror codes are interesting for this: 42000 SYNTAX ERROR OR ACCESS RULE VIOLATION 42601 SYNTAX ERROR "Davor J." 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 >