Re: Max column number.

From: Viktor Bojović <viktor(dot)bojovic(at)gmail(dot)com>
To: Miguel Angel Conte <diafano(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Max column number.
Date: 2011-07-12 20:16:25
Message-ID: CAJu1cLaSk01gdb0ktR_vTg_EC5TkbYf-f85TNOSqvq13_u=XCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Miguel,
maybe you can split table to two tables with one-to-one connection.
The another way is to create dynamic-attribute-tables which means to store
data in columns, not in rows.

On Tue, Jul 12, 2011 at 7:48 PM, Miguel Angel Conte <diafano(at)gmail(dot)com>wrote:

> Hi,
>
> I'm using postgresql 9 and I'd like to know if there is a way to "ask" if
> when I'm going to add a column, I'm exceeding the max number of columns.
> I've found that the max number of columns is 1600 and It's depends of the
> data types.
> I've made a test adding 1600 columns using different data types and I
> didn't have any problem. The problem was when I tried to insert data.
>
> ERROR: row is too big: size 8168, maximum size 8160
>
> I know that the row limit size is 8k by default, but I need a way to
> prevent this exception.
>
> For example, my table have 600 columns and I insert a row with values for
> each column and the row size is 8000. So, in this case If I want to prevent
> errors, I can't add more columns, but to do that I need to know about this
> limit situation.
> Something like:
> "If I'm not going to exceed the size limit, then I can add a new column"
>
> Thanks in advance,
> Miguel.
>

--
---------------------------------------
Viktor Bojović
---------------------------------------
Wherever I go, Murphy goes with me

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2011-07-12 20:45:30 Re: Max column number.
Previous Message Miguel Angel Conte 2011-07-12 18:25:02 Re: Max column number.