Re: MOVE strangeness

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: MOVE strangeness
Дата
Msg-id 200212261841.gBQIfqf27239@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: MOVE strangeness  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: MOVE strangeness  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> > This does not happen
> > if I replace the FETCHes by MOVEs.
> 
> I'm a little confused by that remark; it seems to me that FETCH and MOVE
> have identical behaviors so far as repositioning the cursor is concerned.
> (Internally, MOVE *is* a FETCH, it just suppresses output of the rows.)
> Can you give an example where you get different behavior?

I think I see what Jeroen is saying.  In this example he posted:jtv=> begin;BEGINjtv=> declare c cursor for select *
fromevents;DECLARE CURSORjtv=> fetch 3 in c; year |      event       ------+------------------ 2010 | A Space Oddyssey
2010| Oddyssey Two 2038 | time_t overflow(3 rows)jtv=> move -3 in c;MOVE 2
 

Why does the MOVE -3 return 2?  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?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with move not returning number of rows affected [was: error when using move, any suggestions?]
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Problems with 7.3.1