Re: number of rows returned by a query - Mailing list pgsql-general

From Konstantin Izmailov
Subject Re: number of rows returned by a query
Date
Msg-id AANLkTimXb2f3TXJpWeyfUx9iG0OGxHz-yT48JFaeHpmM@mail.gmail.com
Whole thread Raw
In response to Re: number of rows returned by a query  (Dmitriy Igrishin <dmitigr@gmail.com>)
Responses Re: number of rows returned by a query  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-general
Dmitriy,
It worked like a charm! Bol'shoe spasibo!

I'm curious what are the Postgres versions that support MOVE ALL. The documentation does not even mention "ALL" option.

Konstantin

On Thu, Dec 2, 2010 at 3:49 AM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
Hey Konstantin,

Use MOVE ALL, then PQcmdTuples to get number of rows,
then MOVE BACKWARD ALL to point cursor at initial position.

2010/12/2 Konstantin Izmailov <pgfizm@gmail.com>

Maybe this question was discussed previously, but I could not find an answer:

An application used PQntuples function to obtain number of tuples after executing each query. Since number of rows increased we decided to use DECLARE CURSOR/FETCH commands to retrieve tuples. However, it seems that number of the tuples is not available after DECLARE CURSOR command. We want to minimize the changes in the app. Is it possible to obtain number of rows that a cursor will return?

Thank you
Konstantin





--
// Dmitriy.



pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: how can i bugfix "idle in transaction" lockups ?
Next
From: Guillaume Lelarge
Date:
Subject: Re: number of rows returned by a query