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 <[EMAIL PROTECTED]>

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

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to