Cursor with hold emits the same row more than once across commits in 8.3.7

Поиск
Список
Период
Сортировка
От Mark Kirkwood
Тема Cursor with hold emits the same row more than once across commits in 8.3.7
Дата
Msg-id 4A2DFE0A.6050502@catalyst.net.nz
обсуждение исходный текст
Ответы Re: Cursor with hold emits the same row more than once across commits in 8.3.7  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Short Desc: Cursor with hold emits the same row more than once across
commits in 8.3.7
Os : Debian Etch amd64 / Ubuntu Jaunty amd64
Pg : 8.3.7
Build options: Official package and also compiled from source with
--enable-integer-datetimes
Detailed Desc:

A construction of the form

DECLARE cur CURSOR WITH HOLD FOR SELECT * FROM obj

loop
    FETCH 1000 FROM cur
    process 'em
    COMMIT

results in some of the same rows being emitted more than once, altho the
final rowcount is correct (i.e some rows end up being never seen).

Originally discovered using a perl DBI program, and we wondered if the
version of DBD::Pg might be an issue, so a c library program was written
to test this - and it exhibits the problem too (see attached for schema
and program). The table rows are reasonably wide:


select attname,n_distinct,avg_width from pg_stats where tablename='obj';
   attname   | n_distinct | avg_width
-------------+------------+-----------
 obj_id      |         -1 |         4
 obj_link_id |          5 |         4
 obj_fil     |      13035 |      1188

which may be a factor(tuplestore issues?)... The table is reasonably
sizable (10000000 rows). I can attach the generation program for this
dataset if required.

regards

Mark


Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4843: non standard use string literal warning in RAISE WARNING
Следующее
От: "Andreas Nolte"
Дата:
Сообщение: Bug in pg_dump.exe/pg_restore (Version 8.4 beta 2)