Re: MOVE strangeness

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MOVE strangeness
Дата
Msg-id 2482.1040930080@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MOVE strangeness  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: MOVE strangeness  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: MOVE strangeness  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
Re: MOVE strangeness  (Kevin Brown <kevin@sysexperts.com>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Sorry, I am not understanding.  If he does:
> ...
> here, isn't he sitting at the start of the fourth row, no?

No.  He is sitting *on* the third row.  If he now does FETCH 1, he will
advance to and return the fourth row; on the other hand, if he does
FETCH -1, he will back up to and return the second row.

The cursor must be considered to be positioned on its current row, not
between rows, or the SQL-defined operations UPDATE WHERE CURRENT OF and
DELETE WHERE CURRENT OF don't make any sense.  (We don't support those
yet, but we should someday.)

BTW, looking at Date and the SQL spec, I now realize that the recently
made change to convert FETCH 0 into a no-op is wrong; per spec, FETCH
RELATIVE 0 means "re-fetch the current row, if any".  By analogy, MOVE 0
should probably return "MOVE 1" if you are on a real row, "MOVE 0" if
you are not, corresponding to the number of rows you'd have gotten from
FETCH 0.  Ugly, but ...
        regards, tom lane


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

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