Re: 7.3: Change in cursor behaviour?

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 7.3: Change in cursor behaviour?
Date: 2002-12-02 19:29:03
Message-ID: 1038857343.46704.47.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2002-12-02 at 10:20, Jeroen T. Vermeulen wrote:
> The scenario boils down to: Create a cursor, fetch n rows, move minus 2
> billion or so rows, fetch 1 row. That last fetch used to give me the
> row I was hoping for (the original first row again), but with 7.3 it
> appears to yield nothing.

Seems to work the fine for me:

rbt=# select version();
version
------------------------------------------------------------------------
PostgreSQL 7.4devel on i386-unknown-freebsd4.7, compiled by GCC 2.95.4
(1 row)

rbt=# begin;
BEGIN
rbt=# declare c cursor for select * from pg_attribute;
DECLARE CURSOR
rbt=# fetch 5 from c;
attrelid | attname | atttypid | attstattarget | attlen | attnum |
attndims | attcacheoff | atttypmod | attbyval | attstorage | attisset |
attalign | attnotnull | atthasdef | attisdropped | attislocal |
attinhcount
----------+--------------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+----------+------------+-----------+--------------+------------+-------------
1247 | typname | 19 | -1 | 64 | 1
| 0 | -1 | -1 | f | p | f
| i | t | f | f | t
| 0
1247 | typnamespace | 26 | -1 | 4 | 2
| 0 | -1 | -1 | t | p | f
| i | t | f | f | t
| 0
1247 | typowner | 23 | 0 | 4 | 3
| 0 | -1 | -1 | t | p | f
| i | t | f | f | t
| 0
1247 | typlen | 21 | 0 | 2 | 4
| 0 | -1 | -1 | t | p | f
| s | t | f | f | t
| 0
1247 | typbyval | 16 | 0 | 1 | 5
| 0 | -1 | -1 | t | p | f
| c | t | f | f | t
| 0
(5 rows)

rbt=# move -15 in c;
MOVE 4
rbt=# fetch 1 from c;
attrelid | attname | atttypid | attstattarget | attlen | attnum |
attndims | attcacheoff | atttypmod | attbyval | attstorage | attisset |
attalign | attnotnull | atthasdef | attisdropped | attislocal |
attinhcount
----------+---------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+----------+------------+-----------+--------------+------------+-------------
1247 | typname | 19 | -1 | 64 | 1
| 0 | -1 | -1 | f | p | f
| i | t | f | f | t
| 0
(1 row)

--
Rod Taylor <rbt(at)rbt(dot)ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-12-02 19:37:12 Re: numeric to text (7.3)
Previous Message Peter Eisentraut 2002-12-02 19:25:24 Re: Croatian language file for 7.3