Re: [GENERAL] Getting ROW_COUNT from MOVE in 8.3

2010-10-25 Thread Alban Hertroys
Please leave the ML in the reply-list, so that others might benefit from the answers, comment on the solution, etc etc. ;) On 25 Oct 2010, at 13:55, AI Rumman wrote: > I am using Postgresql 8.1 and facing the similar problem. > Can you provide the link where I get the information what you did wi

Re: [GENERAL] Getting ROW_COUNT from MOVE in 8.3

2010-10-25 Thread Alban Hertroys
On 24 Oct 2010, at 15:41, Reuven M. Lerner wrote: > I've managed to improve things quite a bit by using cursors, but I've been > stumped in trying to find a replacement for the COUNT(*). I wrote a function > that works great on 9.0: > > CREATE OR REPLACE FUNCTION count_the_rows() RETURNS INTEG

Re: [GENERAL] Getting ROW_COUNT from MOVE in 8.3

2010-10-24 Thread Reuven M. Lerner
Hi, Peter. You wrote: But is there any way for me to get, in 8.3, the number of rows over which a cursor has skipped? Keep in mind that after this count has executed, we're then going to rewind the cursor, chunking through the result set with a separate function. You could store the query res

Re: [GENERAL] Getting ROW_COUNT from MOVE in 8.3

2010-10-24 Thread Peter Eisentraut
On sön, 2010-10-24 at 15:41 +0200, Reuven M. Lerner wrote: > But is there any way for me to get, in 8.3, the > number of rows over which a cursor has skipped? Keep in mind that > after > this count has executed, we're then going to rewind the cursor, > chunking > through the result set with a s

[GENERAL] Getting ROW_COUNT from MOVE in 8.3

2010-10-24 Thread Reuven M. Lerner
Hi, everyone. I'm working on an application that needs to perform a query twice -- once to retrieve the total number of rows in a table, and a second that then retrieves chunks of rows. The current implementation executes the query twice, once with COUNT(*) and another with OFFSET and LIMIT b