Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C958B4764C4 for ; Wed, 8 Jan 2003 04:31:25 -0500 (EST) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id B5628475E3E for ; Wed, 8 Jan 2003 04:29:39 -0500 (EST) Received: (qmail 5319 invoked from network); 8 Jan 2003 09:29:40 -0000 Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108) by sd2.tpf-fw-c.co.jp with SMTP; 8 Jan 2003 09:29:40 -0000 Received: from tpf.co.jp (3dgateway1 [126.0.1.60]) by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id SAA15743; Wed, 8 Jan 2003 18:29:39 +0900 (JST) Message-ID: <3E1BEFFE.88B57516@tpf.co.jp> Date: Wed, 08 Jan 2003 18:31:42 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: Tom Lane Cc: Bruce Momjian , pgsql-hackers@postgresql.org Subject: Re: MOVE LAST: why? References: <200301072329.h07NT2X28922@candle.pha.pa.us> <27934.1041984327@sss.pgh.pa.us> <3E1B9DCD.75859501@tpf.co.jp> <501.1041997832@sss.pgh.pa.us> <3E1BA5E6.9463718F@tpf.co.jp> <863.1042000401@sss.pgh.pa.us> <3E1BAFF6.B0114A67@tpf.co.jp> <1082.1042002375@sss.pgh.pa.us> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/389 X-Sequence-Number: 33999 Tom Lane wrote: > > Hiroshi Inoue writes: > > FETCH LAST should return the last one row. > > That's not clear to me. Generally, I would think the cursor should > remain positioned on whatever row is returned, but the spec clearly says > that the final cursor position after FETCH LAST is *after* the last row. In SQL99 the spec you referred to seems the ii) of b) which begins with the word *Otherwise*. I see the following before it. a) If K is greater than 0 (zero) and not greater than N, then CR is positioned on the K-th row of Tt and the corresponding row of T. That row becomes the current row of CR. Then I'm also suspicious if MOVE LAST should mean MOVE ALL. > > FETCH RELATIVE m should return a row after skipping > > m rows if we follow the SQL standard and so the current > > implementation of FETCH RELATIVE is broken. > > No objection to that here. Are you volunteering to make it do that? I'm suspicios if we should implement scrollable cursors with the combination of the current MOVE and FETCH implemen- tation. For example the backwards FETCH operation for group nodes isn't implemented properly yet(maybe). Should we fix it or take another way ? regards, Hiroshi Inoue http://w2422.nsk.ne.jp/~inoue/