Looping through cursor row batches

From: "Henry Combrinck" <henry(at)zen(dot)co(dot)za>
To: pgsql-general(at)postgresql(dot)org
Subject: Looping through cursor row batches
Date: 2008-10-06 11:04:07
Message-ID: 20081006130407.90865lu3o5ih1cw0@zenmail.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

I gather the following isn't possible (which would have been elegant
and ideal):

FOR rec IN
FETCH 100000 FROM cursor
LOOP
...

Anyone know the most efficient way of FETCHing a batch of rows, and
looping through them in a function? FETCHing a record at a time will
work, but I was wondering whether this could be done.

Cheers
Henry

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2008-10-06 11:56:27 Re: restore a dump db from tar file
Previous Message Filip Rembiałkowski 2008-10-06 10:48:24 Re: restore a dump db from tar file