Re: move 0 behaviour

Bruce Momjian <pgman@candle.pha.pa.us>

From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Dave Cramer <dave@fastcrypt.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2002-10-31T04:52:28Z
Lists: pgsql-hackers, pgsql-general

Attachments

Peter Eisentraut wrote:
> Bruce Momjian writes:
> 
> > So, that is why MOVE 0 goes to the end of the cursor.  One idea would be
> > for MOVE 0 to actually move nothing, but jdbc and others need the
> > ability to move the end of the cursor, perhaps to then back up a certain
> > amount and read from there.  Seems MOVE 0 is the logical way to do that.
> > (I can't think of another reasonable value).
> 
> It would seem more logical and reasonable for MOVE 0 to do nothing and
> have some special syntax such as MOVE LAST to move to the end.  (MOVE LAST
> would actually be consistent with the standard syntax FETCH LAST.)

Yea, I started thinking and we need to get MOVE/FETCH to make sense. 
The following patch makes FETCH/MOVE 0 do nothing, and FETCH LAST move
to the end.  I was going to use the word END, but if LAST is more
standard, we will use that.  It uses INT_MAX in the grammar for FETCH
ALL/MOVE LAST, but maps that to zero so it is consistent in the
/executor code.

I will keep this patch for 7.4.

JDBC folks, I realize you need this.  Seems you will have to use MOVE 0
for 7,3 and MOVE LAST for 7.4.

-- 
  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, Pennsylvania 19073