pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: MOVE LAST: why?
Date: Tue, 07 Jan 2003 22:50:32 -0500
Message-ID: <501.1041997832@sss.pgh.pa.us> (raw)
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>

Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> IIRC *FETCH LAST* doesn't mean *FETCH ALL*.

SQL92 says

             ii) If the <fetch orientation> 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



view thread (25+ messages)  latest in thread

Message-ID: <501.1041997832@sss.pgh.pa.us>
Permalink:  ../501.1041997832@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/501.1041997832@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Inoue@tpf.co.jp, pgman@candle.pha.pa.us, pgsql-hackers@postgreSQL.org
  Subject: Re: MOVE LAST: why?
  In-Reply-To: <501.1041997832@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox