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