X-Original-To: pgsql-hackers@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E4690475AF8 for ; Tue, 1 Apr 2003 16:27:00 -0500 (EST) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 09B65475AF8 for ; Tue, 1 Apr 2003 16:26:29 -0500 (EST) Received: (qmail 32636 invoked from network); 1 Apr 2003 21:26:29 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 1 Apr 2003 21:26:29 -0000 Received: from unknown (HELO PbgX) (219.61.40.14) by sd.tpf.co.jp with SMTP; 1 Apr 2003 21:26:29 -0000 From: "Hiroshi Inoue" To: "'Hannu Krosing'" Cc: "'Tom Lane'" , "'Peter Eisentraut'" , "'Bruce Momjian'" , "'Neil Conway'" , "'PostgreSQL Hackers'" Subject: Re: updateable cursors & visibility Date: Wed, 2 Apr 2003 06:26:26 +0900 Message-ID: <003901c2f895$5ac28bf0$0e283ddb@PbgX> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <1049129009.1842.55.camel@fuji.krosing.net> Importance: Normal X-Spam-Status: No, hits=-12.8 required=5.0 tests=BAYES_10,IN_REP_TO,QUOTED_EMAIL_TEXT,QUOTE_TWICE_1 autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/26 X-Sequence-Number: 37516 > -----Original Message----- > From: Hannu Krosing [mailto:hannu@tm.ee] > > Hiroshi Inoue kirjutas E, 31.03.2003 kell 19:08: > > > -----Original Message----- > > > From: Hannu Krosing [mailto:hannu@tm.ee] > > > > > > Hiroshi Inoue kirjutas E, 31.03.2003 kell 03:40: > > > > > > > 2) dynamic > > > > It can detect any changes made to the membership, order, > > > > and values of the result set after the cursor is opened. > > > > > > What would it mean in practice, i.e. if you are on the first > > > row in the > > > cursor and then update tha ORDER BY field so that your > row becomes the > > > last one, will the next FETCH move the cursor past end ? > > > > No. The row next to the old first row would be FETCHed. > > In what way would the _changes_made_to_the_order_ be reflected then ? Once a rowset is fetched, the membership or order in the rowset is fixed until the rowset is invalidated by another fetch operation and the fetch operation is executed for the rowset. > > > what happens, if the row you are on is removed from the > keyset, either > > > by current or any other backend ? > > > > The dynamic cursor doesn't see the row any longer. > > It seems to be doable with MVCC - "just" ;) check for visibility of > underlying tuples at each fetch. At least it does not seem any harder > for MVCC than for other CC methods. MVCC has no particular advantage at this point anyway. > > > > 3) keyset-driven > > > > It always detects changes to the values of rows. > > > > > > What about _new_ rows, > > > > It never detects new rows. > > Then I must have misunderstood the "can detect any changes made to the > membership, order, and values" part. I assumed that "any changes" wold > also include rows that magically become part of the query by either > changes in values or being inserted. It's a spec of dynamic cursors not of keyset-driven ones. > > > or rows that no more belong to the "keyset" ? > > > > They are the same as deleted ones. > > So they are no more visible to cursor ? Yes. regards, Hiroshi Inoue