Re: MOVE LAST: why? - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Re: MOVE LAST: why?
Date
Msg-id 3E1BEFFE.88B57516@tpf.co.jp
Whole thread Raw
In response to Re: MOVE LAST: why?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: MOVE LAST: why?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 
> Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> > FETCH LAST should return the last one row.
> 
> That's not clear to me.  Generally, I would think the cursor should
> remain positioned on whatever row is returned, but the spec clearly says
> that the final cursor position after FETCH LAST is *after* the last row.

In SQL99 the spec you referred to seems the ii) of b) which
begins with the word *Otherwise*. I see the following before it.
   a) If K is greater than 0 (zero) and not greater than N, then CR      is positioned on the K-th row of Tt and the
correspondingrow      of T. That row becomes the current row of CR.
 

Then I'm also suspicious if MOVE LAST should mean MOVE ALL.

> > FETCH RELATIVE m should return a row after skipping
> > m rows if we follow the SQL standard and so the current
> > implementation of FETCH RELATIVE is broken.
> 
> No objection to that here.  Are you volunteering to make it do that?

I'm suspicios if we should implement scrollable cursors
with the combination of the current MOVE and FETCH implemen-
tation. For example the backwards FETCH operation for group
nodes isn't implemented properly yet(maybe). Should we fix
it or take another way ? 

regards,
Hiroshi Inouehttp://w2422.nsk.ne.jp/~inoue/


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: sync()
Next
From: Ian Barwick
Date:
Subject: Re: psql and readline