Re: Willing to fix a PQexec() in libpq module - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Willing to fix a PQexec() in libpq module
Date
Msg-id 22244.1553017591@sss.pgh.pa.us
Whole thread Raw
In response to Re: Willing to fix a PQexec() in libpq module  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2019-03-19 13:18:25 -0400, Tom Lane wrote:
>> Having said that ... a better argument for a new API is that it
>> could be explicitly designed to handle multiple queries, and in
>> particular make some provision for returning multiple PGresults.

> Oh, I completely agree, that'd be hugely useful.

Of course, you can do that already with PQsendQuery + a loop
around PQgetResult.  So the question here is whether that can
be wrapped up into something easier-to-use.  I'm not entirely
sure what that might look like.

We should also keep in mind that there's a perfectly valid
use-case for wanting to send a big script of commands and
just check for overall success or failure.  So it's not like
PQexec's current behavior has *no* valid uses.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Concurrency bug with vacuum full (cluster) and toast
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] CLUSTER command progress monitor