Skip site navigation (1) Skip section navigation (2)

BUG #2970: "FETCH ABSOLUTE -1" from a holdable cursor failed

From: "William ZHANG" <uniware(at)zedware(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2970: "FETCH ABSOLUTE -1" from a holdable cursor failed
Date: 2007-02-06 06:28:15
Message-ID: 200702060628.l166SFg7054170@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2970
Logged by:          William ZHANG
Email address:      uniware(at)zedware(dot)org
PostgreSQL version: 8.2.2
Operating system:   i686-pc-linux-gnu
Description:        "FETCH ABSOLUTE -1" from a holdable cursor failed
Details: 

DROP TABLE foo;
CREATE TABLE foo(fno INT);
INSERT INTO foo VALUES(generate_series(1,5));

BEGIN TRANSACTION; 
DECLARE x SCROLL CURSOR WITH HOLD FOR SELECT fno FROM foo; 
-- fetch all the 5 rows.
-- after that, cursor position should be past last row.
FETCH 10 FROM x; 
COMMIT WORK;
-- try to fetch the last row.
-- it failed.
FETCH ABSOLUTE -1 FROM x; 
CLOSE x;

Responses

pgsql-bugs by date

Next:From: Martin PittDate: 2007-02-06 07:52:19
Subject: BUG #2971: 8.1.7/8.2.2 break constraint checking for 'update'
Previous:From: Tom LaneDate: 2007-02-06 05:09:56
Subject: Re: BUG #2963: PQprepare and transactions.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group