X-Original-To: pgsql-hackers@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DF211475A4B for ; Mon, 24 Mar 2003 17:16:35 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 396C7474E44 for ; Mon, 24 Mar 2003 17:16:35 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2OMGaub020801; Mon, 24 Mar 2003 17:16:37 -0500 (EST) To: Neil Conway Cc: PostgreSQL Hackers Subject: Re: updateable cursors & visibility In-reply-to: <1048542558.421.87.camel@tokyo> References: <1048542558.421.87.camel@tokyo> Comments: In-reply-to Neil Conway message dated "24 Mar 2003 16:49:19 -0500" Date: Mon, 24 Mar 2003 17:16:36 -0500 Message-ID: <20800.1048544196@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.5 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/1048 X-Sequence-Number: 37294 Neil Conway 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