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