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