Re: passing parameters to multiple statements - Mailing list pgsql-general

From Daniel Verite
Subject Re: passing parameters to multiple statements
Date
Msg-id 2ace3e0a-b4d9-4450-94a9-903a33601a4a@mm
Whole thread Raw
In response to Re: passing parameters to multiple statements  (Konstantin Izmailov <pgfizm@gmail.com>)
List 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 by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: passing parameters to multiple statements
Next
From: Joao Ferreira gmail
Date:
Subject: Re: Creating new database