Re: updateable cursors & visibility - Mailing list pgsql-hackers

From Tom Lane
Subject Re: updateable cursors & visibility
Date
Msg-id 20800.1048544196@sss.pgh.pa.us
Whole thread Raw
In response to updateable cursors & visibility  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> - if the user updates a row X in the cursor, then rewinds the cursor and
> fetches X again, should they see the new X or the old X?

If it's considered an insensitive cursor, I'd think it should see the
old X.  You would have a hard time making the code do otherwise in any
case --- the cursor's snapshot is frozen when the cursor is created.

> - if the user updates a row X in the cursor, and then a query within the
> cursor's transaction views X, should the query see new X or old X?

The subsequent query (if it's not going through the cursor) should and
will see the new X.

This should all be handled for you by the command-counter-based
visibility rules; I don't think you need to worry about it.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: updateable cursors & visibility
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: DEFAULT in