Search Postgresql Archives

Re: Looping through cursor row batches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Henry Combrinck" <henry@xxxxxxxxx> writes:
> 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.

You're outsmarting yourself.  plpgsql already does the equivalent of
this under the hood, there is no need for you to try to make it happen
at user level.  Just use a plain ol' FOR rec IN SELECT and forget the
explicit cursor.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux