## Re: MOVE strangeness

From: Tom Lane Bruce Momjian "Jeroen T(dot) Vermeulen" ,pgsql-hackers(at)postgresql(dot)org Re: MOVE strangeness 2002-12-26 18:58:31 2383.1040929111@sss.pgh.pa.us (view raw or whole thread) 2002-12-26 01:44:30 from "Jeroen T(dot) Vermeulen"  2002-12-26 18:26:11 from Tom Lane   2002-12-26 18:41:52 from Bruce Momjian    2002-12-26 18:58:31 from Tom Lane     2002-12-26 19:04:07 from Bruce Momjian      2002-12-26 19:14:40 from Tom Lane       2002-12-26 22:24:17 from Bruce Momjian       2002-12-27 04:15:47 from "Jeroen T(dot) Vermeulen"        2002-12-27 05:18:42 from Tom Lane       2002-12-27 08:04:36 from Kevin Brown        2002-12-27 17:26:22 from Tom Lane         2002-12-30 00:39:37 from Kevin Brown          2002-12-30 18:50:52 from Manfred Koizar       2002-12-27 14:03:20 from Bruce Momjian        2002-12-27 14:48:19 from Bruce Momjian pgsql-hackerspgsql-patches
```Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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 by date

 Next: From: Bruce Momjian Date: 2002-12-26 19:04:07 Subject: Re: MOVE strangeness Previous: From: Tom Lane Date: 2002-12-26 18:44:51 Subject: Re: Problems with 7.3.1

### pgsql-patches by date

 Next: From: Bruce Momjian Date: 2002-12-26 19:04:07 Subject: Re: MOVE strangeness Previous: From: Bruce Momjian Date: 2002-12-26 18:41:52 Subject: Re: MOVE strangeness