Re: [BUGS] Too large tuples corrupting tables

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Stolk <stolkd@email.com>
Cc: pgsql-bugs@postgresql.org
Date: 1999-12-07T02:18:41Z
Lists: pgsql-bugs
Daniel Stolk <stolkd@email.com> writes:
> I seem to have a problem here.  When I try to insert a tuple that is
> larger than 8192 bytes, I get an error message saying that the tuple
> is too large.  Ok, that's fine, since the BLCK_SIZE is 8192.  But the
> problem is that the table seems to become corrupted.  After I do this
> insert statement I went to psql and did a select on the table (which
> doesn't have any tuples in it).

The table was initially empty, you say?  I think I just fixed that bug
en passant a day or two ago: it looked like the oversize-tuple test
was applied after appending a page to the empty relation, but before
writing out a valid page header to that page :-(.  Problem didn't occur
as long as there was already at least one page in the relation.

If anyone wants to backpatch this fix into 6.5.*, it's in
RelationPutHeapTupleAtEnd() in src/backend/access/heap/hio.c.
I just moved the test for oversize tuple up to the top.

			regards, tom lane