Manfred Koizar <mkoi-pg@aon.at> writes:
> On Thu, 11 Sep 2003 14:24:25 -0700, Sean Chittenden
> <sean@chittenden.org> wrote:
>> Agreed, but if anyone has a table with close to 1600 columns in a
>> table...
> This 1600 column limit has nothing to do with block size. It is
> caused by the fact that a heap tuple header cannot be larger than 255
> bytes, so there is a limited number of bits in the null bitmap.
Right, but that's not the only limit on number of columns. A tuple has
to be able to fit into a page. If all your columns are toastable types,
and you toast every one of them, then the toast pointers are 20 bytes
each, so with 8K block size the maximum usable number of columns is
somewhere around 400. If the columns were all int8 or float8 the limit
would be about 1000 columns; etc. But raise the page size, and these
limits increase, possibly allowing the 1600 number to become the actual
limiting factor.
regards, tom lane