Re: Looping through cursor row batches

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Looping through cursor row batches
Дата
Msg-id 18629.1223295969@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Looping through cursor row batches  ("Henry Combrinck" <henry@zen.co.za>)
Список pgsql-general
"Henry Combrinck" <henry@zen.co.za> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: restore a dump db from tar file
Следующее
От: "Alain Roger"
Дата:
Сообщение: Re: restore a dump db from tar file