Re: MOVE LAST: why?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MOVE LAST: why?
Дата
Msg-id 501.1041997832@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MOVE LAST: why?  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Список 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 по дате отправления:

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: MOVE LAST: why?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] I feel the need for speed. What am I doing wrong?