Re: passing parameters to multiple statements

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: passing parameters to multiple statements
Дата
Msg-id 2ace3e0a-b4d9-4450-94a9-903a33601a4a@mm
обсуждение исходный текст
Ответ на Re: passing parameters to multiple statements  (Konstantin Izmailov <pgfizm@gmail.com>)
Список pgsql-general
    Konstantin Izmailov wrote:

> Some companies have policy to stay DB agnostic, i.e. use standard SQL only.

Good luck with that. For example, querying the lastval of a sequence, as your
sample code does, already falls outside of standard SQL, AFAIK.

> If PQexecParams does not support multiple statements, it needs to be
> extended for the support, or new function created for the purpose. If I do
> the change in libpq, may I submit the code to community?

That change would not be in libpq but in the server. libpq doesn't parse SQL
statements.
I wish I could say that in future versions you'd be likely to use the DO
clause to the effect of grouping statements in one SQL block, in a modern and
supported way (DO is in the 8.5 alpha release).

Unfortunately DO doesn't seem to accept parameters, which makes it less
useful than it could be otherwise. Personally I know I won't really be able
to use the DO blocks if I can't pass parameters to them like if it was a
single INSERT or UPDATE statement, the use cases being the same to me.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: passing parameters to multiple statements
Следующее
От: Joao Ferreira gmail
Дата:
Сообщение: Re: Creating new database