Re: libpq and prepared statements progress for 8.0 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: libpq and prepared statements progress for 8.0
Date
Msg-id 11157.1095690003@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq and prepared statements progress for 8.0  (Abhijit Menon-Sen <ams@oryx.com>)
Responses Re: libpq and prepared statements progress for 8.0  (Abhijit Menon-Sen <ams@oryx.com>)
List pgsql-hackers
Abhijit Menon-Sen <ams@oryx.com> writes:
> Execute can be told to return no more than n rows of results. If there
> are more rows available, the server returns PortalSuspended and awaits
> another Execute message. The default of 0 imposes no limit.

> Because it's sometimes required to call Execute without Binding values
> again, libpq needs separate bind/execute functions to support this.

I don't really think so.  Allowing access to the limited-row-count
version of Execute would fundamentally break the PGresult abstraction,
which thinks of a query result as a monolithic entity.

There has been talk from time to time of developing a new API (possibly
a whole new library?) that would allow streaming access, but I would
strongly urge you not to try to solve that problem at the same time;
if only because there is zero chance of such a patch being accepted
within the 8.0 cycle.

In my mind the existing PQexecPrepared operation is all you need to
support binding and execution of prepared statements.  What you should
be concerned with right now is providing an API for Parse + Describe
Statement, to substitute for the existing approach of setting up
statement objects via PQexec("PREPARE foo ...").
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: transaction idle timeout in 7.4.5 and 8.0.0beta2
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: libpq and prepared statements progress for 8.0