Re: checking select query syntax and semantics via php without executing

Поиск
Список
Период
Сортировка
От Marco Dieckhoff
Тема Re: checking select query syntax and semantics via php without executing
Дата
Msg-id 4ACA6D38.4010005@gmx.de
обсуждение исходный текст
Ответ на Re: checking select query syntax and semantics via php without executing  (Bill Moran <wmoran@potentialtech.com>)
Ответы Re: checking select query syntax and semantics via php without executing  (Christophe Pettus <xof@thebuild.com>)
Список pgsql-php
Bill Moran schrieb:
> In response to Marco Dieckhoff <dieck@gmx.de>:
>> Hi there!
>>
>> Is it possible in PHP to give a sql (select) query to Postgres via pg_*
>> so that it is NOT executed but merely checked for syntax including
>> correct, existing field and table names, and data types?

> Off the top of my head, you could prefix the query with EXPLAIN, which
> will cause it to be planned (thus checking syntax) and return an
> execution plan, but not actually run the query.

Works as a charm, thanks to both of you.

Must be one of the quickest "case solved, thread closed" I have ever seen :)



В списке pgsql-php по дате отправления:

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: checking select query syntax and semantics via php without executing
Следующее
От: Christophe Pettus
Дата:
Сообщение: Re: checking select query syntax and semantics via php without executing