Re: MOVE LAST: why?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: MOVE LAST: why?
Date: 2003-01-08 03:50:32
Message-ID: 501.1041997832@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-01-08 04:07:35 Re: [GENERAL] I feel the need for speed. What am I doing wrong?
Previous Message Hiroshi Inoue 2003-01-08 03:41:01 Re: MOVE LAST: why?

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-01-08 04:12:31 Re: [ADMIN] pgdb.py is still wrong in Postgres 7.3.1 rpm
Previous Message Hiroshi Inoue 2003-01-08 03:41:01 Re: MOVE LAST: why?