Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7FCB7475C9E for ; Tue, 7 Jan 2003 22:50:42 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id DE461475956 for ; Tue, 7 Jan 2003 22:50:41 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h083oW0U000502; Tue, 7 Jan 2003 22:50:32 -0500 (EST) To: Hiroshi Inoue Cc: Bruce Momjian , pgsql-hackers@postgreSQL.org Subject: Re: MOVE LAST: why? In-reply-to: <3E1B9DCD.75859501@tpf.co.jp> References: <200301072329.h07NT2X28922@candle.pha.pa.us> <27934.1041984327@sss.pgh.pa.us> <3E1B9DCD.75859501@tpf.co.jp> Comments: In-reply-to Hiroshi Inoue message dated "Wed, 08 Jan 2003 12:41:01 +0900" Date: Tue, 07 Jan 2003 22:50:32 -0500 Message-ID: <501.1041997832@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/369 X-Sequence-Number: 33979 Hiroshi Inoue writes: > IIRC *FETCH LAST* doesn't mean *FETCH ALL*. SQL92 says ii) If the implicitly or explicitly spec- ifies NEXT, specifies ABSOLUTE or RELATIVE with K greater than N, or specifies LAST, then CR is positioned after the ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ last row. ^^^^^^^^ So as far as the ending cursor position is concerned, LAST agrees with ALL. It looks to me like the SQL definition only contemplates returning a single row, but it's less than clear *which* row they mean for LAST. > In addition *FETCH 0* seems to be changed to mean > *FETCH RELATIVE 0* currently. Is it reasonable ? Sure. FETCH n in Postgres has always corresponded to FETCH RELATIVE n. regards, tom lane