Re: 7.2.3: tuple is too big (max 8136) - Mailing list pgsql-general

From Tom Lane
Subject Re: 7.2.3: tuple is too big (max 8136)
Date
Msg-id 25508.1036376394@sss.pgh.pa.us
Whole thread Raw
In response to Re: 7.2.3: tuple is too big (max 8136)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> Technically there is still a tuple size limit.  It's just that many types
> can be pulled out of the main storage of the table and you get a reference
> to its value in the main storage rather than the value itself.  That's how
> the 8k limit was circumvented.  The tuple size limit is part of why
> there's a maximum column count, AFAIK the main tuple still needs to fit in
> one page.

Right.  You could fit 1600 int4 columns (6400 bytes total), but not 1600
int8 columns.  TOAST pointer entries are 20 bytes each, so if all your
columns are toastable types (like varchar) then the upper limit would be
about 400 columns.

In practice, performance will probably suck with more than a couple
hundred columns anyway.  You'd be better off rethinking your database
design.

            regards, tom lane

pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Spanish version of the PostgreSQL "Advocacy and Marketing" site is ready
Next
From: "Matthew Nuzum"
Date:
Subject: quoting and EXECUTE in plpgsql function