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