Re: MOVE strangeness

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MOVE strangeness
Дата
Msg-id 2383.1040929111@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MOVE strangeness  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: MOVE strangeness  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Why does the MOVE -3 return 2?

Because he's successfully backed up over 2 real rows.  Had he done FETCH
-3 in the same situation, he'd have gotten back 2 rows; there is no
third row it could have returned, so it's hard to argue that the count
should be anything but 2.  (If you think it should be 3, what if I say
MOVE -10000?  Should I get back a count of 10000?)

> If he has fetched 3, he is at the end of
> the third row.  If he does MOVE -3, hasn't he moved backward three rows
> to the start of the first row?

There is no "end of a row" as distinct from "start of a row".  You can
be on a row, or before the first row, or after the last row.  There is
no other state besides that.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problems with 7.3.1
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: MOVE strangeness