On Thu, Feb 18, 2021 at 9:00 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote:
> > And that seems definitely wrong. Declaring c1 in the above example as > FOR UPDATE or FOR SHARE does not change the result. I think this > discussion is mixing up the concept of cursor sensitivity with > transaction isolation. > > Thoughts? > > This came up on Discord in the context of pl/pgsql last month - never really came to a conclusion. " open curs FOR SELECT * FROM Res FOR UPDATE; LOOP FETCH curs into record; EXIT WHEN NOT FOUND; INSERT INTO Res SELECT Type.Name FROM Type WHERE Type.SupClass = record.Name; END LOOP; " The posted question was: "this doesn't go over rows added during the loop despite the FOR UPDATE" The OP was doing a course based on Oracle and was confused regarding our behavior. The documentation failed to help me provide a useful response, so I'd agree there is something here that needs reworking if not outright fixing. David J.