We have this in the CURSOR documentation:

       Once  all  rows  are  fetched,  every  other  fetch access
       returns no rows.

Is this still true?

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 4 Apr 2000 15:26:19 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
CURSOR after hitting end
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> We have this in the CURSOR documentation:
>        Once  all  rows  are  fetched,  every  other  fetch access
>        returns no rows.

> Is this still true?

Not if you then move or fetch backwards, I should think...

			regards, tom lane

Tue, 04 Apr 2000 15:59:32 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: CURSOR after hitting end 
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > We have this in the CURSOR documentation:
> >        Once  all  rows  are  fetched,  every  other  fetch access
> >        returns no rows.
> 
> > Is this still true?
> 
> Not if you then move or fetch backwards, I should think...

No, it works.  I think Tatsuo fixed it.  After a FETCH ALL, I did this,
and it worked:


	test=> fetch -1  from bigtable_cursor;
	 customer_id 
	-------------
	        1000
	(1 row)
	
	test=> fetch -1  from bigtable_cursor;
	 customer_id 
	-------------
	         999
	(1 row)

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 4 Apr 2000 16:04:50 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: CURSOR after hitting end
> -----Original Message-----
> From: pgsql-hackers-owner@hub.org [mailto:pgsql-hackers-owner@hub.org]On
> Behalf Of Bruce Momjian
> 
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > We have this in the CURSOR documentation:
> > >        Once  all  rows  are  fetched,  every  other  fetch access
> > >        returns no rows.
> > 
> > > Is this still true?
> > 
> > Not if you then move or fetch backwards, I should think...
> 
> No, it works.  I think Tatsuo fixed it.  After a FETCH ALL, I did this,
> and it worked:
>

This is true and false.
For index scan I fixed it before 6.5 and for sequential scan
I fixed it before 7.0.

However there remains some type of scan that returns no rows
after hitting end.
Especially for GROUP BY,*fetch backward* doesn't work well 
fundamentally.  I have known this but I've never seen bug
reports for this.  It's not so easy to fix this and it wouldn't be
an effective way to scan base relation again for *GROUP BY*.

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp

Wed, 5 Apr 2000 08:59:35 +0900
"Hiroshi Inoue" <Inoue@tpf.co.jp>
RE: CURSOR after hitting end
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > We have this in the CURSOR documentation:
> > >        Once  all  rows  are  fetched,  every  other  fetch access
> > >        returns no rows.
> > 
> > > Is this still true?
> > 
> > Not if you then move or fetch backwards, I should think...
> 
> No, it works.  I think Tatsuo fixed it.  After a FETCH ALL, I did this,
			 ~~~~~~must be Hiroshi...
> and it worked:
--
Tatsuo Ishii

Wed, 05 Apr 2000 09:16:48 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: CURSOR after hitting end