howto determine rows count to be returned by DECLARE ... SELECT ...

From: Konstantin Izmailov <pgfizm(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: howto determine rows count to be returned by DECLARE ... SELECT ...
Date: 2009-07-06 07:21:43
Message-ID: 72746b5e0907060021q47ae6c14hacdc3660bbcfe9b4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Community,
I'm working on implementation of virtual grid using DECLARE... SELECT....
Advantage of virtual grid is that it loads only rows that a user is willing
to see (with FETCH).

However, it is not clear how to determine max rows count that the cursor can
return. The count is necessary for two purposes: render scrollbar and
support jumping to the last rows in the grid.

The only obvious solution is to execute SELECT COUNT(1) ... before declaring
the cursor.

Is there a better solution?

Can the cursor return total rows count or is there a way to position cursor
to the last row? (Then the number of roundtrips to server can be less by 1
and virtual grid can render last rows in reverse order).

Thank you,
K.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2009-07-06 07:33:50 Re: Documentation - PgAdmin
Previous Message Guillaume Lelarge 2009-07-06 06:57:26 Re: [GENERAL] Documentation - PgAdmin