Prepared queries and portals - Mailing list pgsql-hackers

From Cyril VELTER
Subject Prepared queries and portals
Date
Msg-id 02c401c40160$6304be80$f901a8c0@cvfixe
Whole thread Raw
In response to Re: simple make check failures  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Prepared queries and portals
List pgsql-hackers
   While adapting an application to make use of the new protocol, I've
faced one problem. I cannot execute a prepared query and fetch the result in
several time. The multiple fetch is accessible with cursor in SQL but I
haven't found any way to execute a prepared query in a cursor.
   The documentation clearly state that the protocol support this beahvior,
so I've modified libpq to handle the case by adding to functions :


PQexecPreparedPortal(conn,stmtName,portalName,nParams,paramValues,paramlengt
h,paramFormats,resultFormat,maxrows);
   and
   PQfetchPortal(conn,portalName,maxrows)

   PQexecPreparedPortal is a PQexecPrepared clone but you can specify the
portal in which the result should be put (which might be the unnamed one)
and the maximum number of rows to retreive after the execution.
   PQfetchPortal fetch the next rows.
   This works nicely. I would like to see this included in the standard
libpq, and will submit a patch if this might be usefull, but as it extend
the libpq API there might be more general plan to support the functionality.
   Any comments ?

   cyril



pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: [PERFORM] WAL Optimisation - configuration and usage
Next
From: "Simon Riggs"
Date:
Subject: The Return of PITR