Re: passing parameters to multiple statements

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: passing parameters to multiple statements
Date: 2009-11-18 15:08:08
Message-ID: 2ace3e0a-b4d9-4450-94a9-903a33601a4a@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joao Ferreira gmail 2009-11-18 15:12:48 Re: Creating new database
Previous Message Thomas Kellerer 2009-11-18 15:03:18 Re: passing parameters to multiple statements