Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 97B6F476C05 for ; Tue, 7 Jan 2003 23:56:23 -0500 (EST) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id A856F476C01 for ; Tue, 7 Jan 2003 23:56:22 -0500 (EST) Received: (qmail 11480 invoked from network); 8 Jan 2003 04:56:27 -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 04:56:27 -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 NAA15662; Wed, 8 Jan 2003 13:56:27 +0900 (JST) Message-ID: <3E1BAFF6.B0114A67@tpf.co.jp> Date: Wed, 08 Jan 2003 13:58:30 +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> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/374 X-Sequence-Number: 33984 Tom Lane wrote: > > Hiroshi Inoue writes: > > Tom Lane wrote: > >> Sure. FETCH n in Postgres has always corresponded to FETCH RELATIVE n. > > > IIRC in SQL standard FETCH retrieves rows one by one. > > Yes, Postgres' idea of FETCH is only weakly related to the spec's idea. > But I believe you get similar results if you consider only the row last > returned by our FETCH. FETCH n is a PostgreSQL's extention to retrieve multiple rows by one FETCH not related to FETCH RELATIVE at all. FETCH LAST should return the last one row. 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. regards, Hiroshi Inoue http://w2422.nsk.ne.jp/~inoue/