On Sat, Jun 10, 2006 at 10:43:02PM -0400, Angus Berry wrote:
> Ahhh... thank you. This clarifies TOAST for me. I see how TOAST applies
> to individual columns that exceed the 8k page size.
>
> Postgres specs state it's possible to have 2GB rows and up to 1,600
> columns. Can you tell me what data type would get to fill this spec. I
> wouldn't normally push to this limit, but I am expecting to have to
> defend Postgres specs. to a 3rd party.
Any variable length datatype might be able to go to 2GB. Things like
text, char, varchar and bytea are the obvious ones. Arrays too IIRC.
However, as pointed out, even a toasted field takes about 20 bytes,
which means you're limited to maybe 400 toasted fields. If you use
integers you can get to 1600.
Normally however, in cases where you need to store a lot of columns,
what you really want is an array. You could easily store an array with
a few million numerics in a single field...
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.