Re: Function with limit and offset - PostgreSQL 9.3

From: marcinha rocha <marciaestefanidarocha(at)hotmail(dot)com>
To: "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 02:13:37
Message-ID: CY1PR18MB0490D612F30BDD2D7AA4606FAFCE0@CY1PR18MB0490.namprd18.prod.outlook.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<mailto:marciaestefanidarocha(at)hotmail(dot)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!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-06-09 02:47:49 Re: Function with limit and offset - PostgreSQL 9.3
Previous Message David G. Johnston 2017-06-09 01:49:43 Re: Function with limit and offset - PostgreSQL 9.3