Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3 - Mailing list pgsql-general

From marcinha rocha
Subject Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3
Date
Msg-id CY1PR18MB0490D612F30BDD2D7AA4606FAFCE0@CY1PR18MB0490.namprd18.prod.outlook.com
Whole thread Raw
In response to Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3
List pgsql-general

On Thursday, June 8, 2017, marcinha rocha <marciaestefanidarocha@hotmail.com> wrote:

On my original select, the row will have migrated = false. Maybe All I need to put is a limit 2000 and the query will do the rest?


You shoud try to avoid the for loop, 

Why?

but yes a limit 2000 on the for loop query should work since the migrated flag will ensure the same rows aren't selected again.

David J. 


Ok, cool!

Now, how do tell the function to return the number of touched rows? On this case, it should always be 2000.

Thanks!

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3
Next
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] Function with limit and offset - PostgreSQL 9.3