Prepared queries and portals
От | Cyril VELTER |
---|---|
Тема | Prepared queries and portals |
Дата | |
Msg-id | 02c401c40160$6304be80$f901a8c0@cvfixe обсуждение исходный текст |
Ответ на | Re: simple make check failures (Bruce Momjian <pgman@candle.pha.pa.us>) |
Ответы |
Re: Prepared queries and portals
|
Список | 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 по дате отправления: