Re: 7.3: Change in cursor behaviour?

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: 7.3: Change in cursor behaviour?
Дата
Msg-id 1038857343.46704.47.camel@jester
обсуждение исходный текст
Ответ на 7.3: Change in cursor behaviour?  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
Ответы Re: 7.3: Change in cursor behaviour?
Список 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,
compiledby 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@rbt.ca>

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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Croatian language file for 7.3
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: numeric to text (7.3)