Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3
Дата
Msg-id CAKFQuwaoeuEAuzXCYTozmzRuOaF0aFTywh7D14-vWyPMGKsdvQ@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Function with limit and offset - PostgreSQL 9.3  (marcinha rocha <marciaestefanidarocha@hotmail.com>)
Список pgsql-general
On Thursday, June 8, 2017, marcinha rocha <marciaestefanidarocha@hotmail.com> wrote:

When I call the function, it must execute 2000 rows and then stop. Then when calling it again, it must start from 2001 to 4000, and so on

You can do this is with plain sql with the help of a CTE.  Insert into + Select ... limit 2000 returning id.  Migration done.  Put that in a CTE.  In the outer query perform the update by referencing the returned rows from the CTE.

David J.

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

Предыдущее
От: marcinha rocha
Дата:
Сообщение: [GENERAL] Function with limit and offset - PostgreSQL 9.3
Следующее
От: John R Pierce
Дата:
Сообщение: Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3