From: Dirk Lutzebaeck <lutzeb@aeccom.com>
To: Patrik Kudo <kudo@partitur.se>
Cc: pgsql-sql@postgreSQL.org <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] Problem with large tuples.
Date: Fri, 21 Jan 2000 16:38:37 +0100 (CET)
Message-ID: <14472.32125.181522.797383@ampato.aeccom.com> (raw)
In-Reply-To: <388875D0.21942465@partitur.se>
References: <388875D0.21942465@partitur.se>
Patrik Kudo writes:
> I've noticed that some of my tables with large text tuples have
> problem when these exceed some certain size. I know about the
> 8k tuplesize limit, but it seems the problem appears earlier
> than that. This is what I've been able to recreate:
>
> CREATE TABLE sizetest (id int, txt text);
> INSERT INTO sizetest (id, txt) VALUES (1, '...'); // ... = string of
> 4000 chars
> vacuum analyze; // <-- works nicely
> INSERT INTO sizetest (id, txt) VALUES (2, '...'); // ... = string of
> 4100 chars
> vacuum analyze;
> ERROR: Tuple is too big: size 8152, max size 8140
>
> How come the insert works while the vacuum fails?
It's a bug. You need this patch against 6.5.3:
inline patch 1: src/backend/commands/vacuum.c (+13/-2 lines) download inline-1.patch*** src/backend/commands/vacuum.c.orig Wed Aug 25 08:01:45 1999
--- src/backend/commands/vacuum.c Tue Jan 4 12:15:17 2000
***************
*** 2405,2414 ****
stup = heap_formtuple(sd->rd_att, values, nulls);
/* ----------------
! * insert the tuple in the relation and get the tuple's oid.
* ----------------
*/
! heap_insert(sd, stup);
pfree(DatumGetPointer(values[3]));
pfree(DatumGetPointer(values[4]));
pfree(stup);
--- 2405,2425 ----
stup = heap_formtuple(sd->rd_att, values, nulls);
/* ----------------
! * Watch out for oversize tuple, which can happen if
! * both of the saved data values are long.
! * Our fallback strategy is just to not store the
! * pg_statistic tuple at all in that case. (We could
! * replace the values by NULLs and still store the
! * numeric stats, but presently selfuncs.c couldn't
! * do anything useful with that case anyway.)
* ----------------
*/
! if (MAXALIGN(stup->t_len) <= MaxTupleSize)
! {
! /* OK to store tuple */
! heap_insert(sd, stup);
! }
!
pfree(DatumGetPointer(values[3]));
pfree(DatumGetPointer(values[4]));
pfree(stup);
After patching you should remove your statistics with
'DELETE FROM pg_statistic';
You might also need to patch vio.c. Get it from the latest snapshot...
Go back in the pgsql-bugs archive to read more about this problem. It
was discussed some weeks ago...
Dirk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: lutzeb@aeccom.com, kudo@partitur.se
Subject: Re: [SQL] Problem with large tuples.
In-Reply-To: <14472.32125.181522.797383@ampato.aeccom.com>
References: <388875D0.21942465@partitur.se> <14472.32125.181522.797383@ampato.aeccom.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox