Re: Function with limit and offset - PostgreSQL 9.3

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: marcinha rocha <marciaestefanidarocha(at)hotmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Function with limit and offset - PostgreSQL 9.3
Date: 2017-06-09 01:05:47
Message-ID: CAKFQuwaoeuEAuzXCYTozmzRuOaF0aFTywh7D14-vWyPMGKsdvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, June 8, 2017, marcinha rocha <marciaestefanidarocha(at)hotmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-06-09 01:13:26 Re: Function with limit and offset - PostgreSQL 9.3
Previous Message marcinha rocha 2017-06-09 00:53:38 Function with limit and offset - PostgreSQL 9.3