Search Postgresql Archives

Re: Function with limit and offset - PostgreSQL 9.3

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

 



On Thursday, June 8, 2017, marcinha rocha <marciaestefanidarocha@xxxxxxxxxxx> 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.

[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