pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
1600 column limit per table
2+ messages / 2 participants
[nested] [flat]

* 1600 column limit per table
@ 2008-05-23 19:35 Mike Weber <j_weber@tcdi.com>
  2008-05-23 20:31 ` Re: 1600 column limit per table Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Mike Weber @ 2008-05-23 19:35 UTC (permalink / raw)
  To: pgsql-admin

I ran into the 1600 column upper bound in a table and I am trying to 
assess if I can work around the limit or if I am in need of a re-design 
of my application.  All the documentation on the site that I have seen 
(CREATE TABLE and postgresql.org/about/) says that 1600 is the limit, I 
looked in htup.h and found:

./src/include/access/htup.h:#define MaxHeapAttributeNumber      1600    
/* 8 * 200 */

with documentation to explain the limitation.  The one ray of hope I 
found was a post from 2001(!) suggesting that the maximum number of 
columns can be increased 4x by increasing one's block size to 32k ( 
http://archives.postgresql.org/pgsql-admin/2001-01/msg00199.php )

One thought I had was to join two 1600 column tables but ran into the 
limit of 1664 tuples.

I'm currently using 8.1.10 -- are there any easy outs(via upgrade, 
configuration, or hacking postgres a little) or should I start drawing 
up a different application design?

Thanks,
Mike



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: 1600 column limit per table
  2008-05-23 19:35 1600 column limit per table Mike Weber <j_weber@tcdi.com>
@ 2008-05-23 20:31 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2008-05-23 20:31 UTC (permalink / raw)
  To: Mike Weber <j_weber@tcdi.com>; +Cc: pgsql-admin

Mike Weber <j_weber@tcdi.com> writes:
> I ran into the 1600 column upper bound in a table and I am trying to 
> assess if I can work around the limit or if I am in need of a re-design 
> of my application.

You need to redesign.  The 1600 limit has some slop (intentionally)
but not a lot of slop --- I think the hard maximum without breaking
compatibility with 8.1's on-disk format would be 1736.

Most people think that rows that wide are a sign of bad SQL design
anyway, which is why there's not been any interest in trying to
raise the limit.  Perhaps you could collapse multiple similar columns
into an array column?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2008-05-23 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-05-23 19:35 1600 column limit per table Mike Weber <j_weber@tcdi.com>
2008-05-23 20:31 ` Tom Lane <tgl@sss.pgh.pa.us>

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