Looping through cursor row batches - Mailing list pgsql-general

From Henry Combrinck
Subject Looping through cursor row batches
Date
Msg-id 20081006130407.90865lu3o5ih1cw0@zenmail.co.za
Whole thread Raw
Responses Re: Looping through cursor row batches  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-general by date:

Previous
From: "Filip Rembiałkowski"
Date:
Subject: Re: restore a dump db from tar file
Next
From: "Albe Laurenz"
Date:
Subject: Re: restore a dump db from tar file