I am building a procedure to label database rows if certain records meet some conditions.
I am looping over rows using cursor and for every row I check for some conditions, if conditions are met I update that row. I need to check around 150 million rows.
The thing is that I need to check, for every row that is in cursor, its spatial relations with every other row from that table. I am using postgis for this task. Basically I need to do some spatial join between current record and other rows in a database. This may result in another set of rows that I need to update. I am planning to open new cursor for this task, loop over and update them.
My question is: If I update rows,in the same table, using second (nested) cursor will changes be visible to the first cursor at the moment of update, because some of the rows updated using second cursor can be also in the first cursor?
WITH HOLD). But I agree that we need to see more of the code before we can give good advice.