pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Neil Conway <neilc@samurai.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: updateable cursors & visibility
Date: Mon, 24 Mar 2003 17:16:36 -0500
Message-ID: <20800.1048544196@sss.pgh.pa.us> (raw)
In-Reply-To: <1048542558.421.87.camel@tokyo>
References: <1048542558.421.87.camel@tokyo>

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




view thread (34+ messages)  latest in thread

Message-ID: <20800.1048544196@sss.pgh.pa.us>
Permalink:  ../20800.1048544196@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20800.1048544196@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, neilc@samurai.com
  Subject: Re: updateable cursors & visibility
  In-Reply-To: <20800.1048544196@sss.pgh.pa.us>
  References: <1048542558.421.87.camel@tokyo> <20800.1048544196@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox