Re: MOVE LAST: why? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: MOVE LAST: why?
Date
Msg-id 501.1041997832@sss.pgh.pa.us
Whole thread Raw
In response to Re: MOVE LAST: why?  (Hiroshi Inoue <Inoue@tpf.co.jp>)
List pgsql-hackers
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
orRELATIVE 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


pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: MOVE LAST: why?
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] I feel the need for speed. What am I doing wrong?