BUG #4553: HOLD cursors not materializing results fully - Mailing list pgsql-bugs

From Andrew Gierth
Subject BUG #4553: HOLD cursors not materializing results fully
Date
Msg-id 200811290307.mAT37nZ4047841@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4553: HOLD cursors not materializing results fully  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4553
Logged by:          Andrew Gierth
Email address:      andrew@tao11.riddles.org.uk
PostgreSQL version: 8.3-8.4
Operating system:   all
Description:        HOLD cursors not materializing results fully
Details:

(tested on 8.3.5 and HEAD as of a few weeks ago)

The materialization logic for holdable cursors isn't detoasting data prior
to storage in the portal's tuplestore, which leads to problems like this:

postgres=# create table test1 (a text);
CREATE TABLE
postgres=# insert into test1 values
(repeat('daafadslksdfalkeshfalkhfalsdjfhalsjdfhaldjfhalkfhd',10000));
INSERT 0 1
postgres=# declare testcur cursor with hold for select * from test1;
DECLARE CURSOR
postgres=# delete from test1;
DELETE 1
postgres=#                                                          vacuum
test1;
VACUUM
postgres=#
fetch first from testcur;
ERROR:  missing chunk number 0 for toast value 65571 in pg_toast_65565

Obviously truncate, etc., is affected too.

pgsql-bugs by date:

Previous
From: John R Pierce
Date:
Subject: Re: BUG #4551: Implementation of the "line" type..
Next
From: Tom Lane
Date:
Subject: Re: BUG #4553: HOLD cursors not materializing results fully