Max column number. - Mailing list pgsql-sql

From Miguel Angel Conte
Subject Max column number.
Date
Msg-id CAB+MjFNbwOcBdeMZQBKeNnWa8gGXHBLU-1dvs+3S32C0qZ9Agg@mail.gmail.com
Whole thread Raw
Responses Re: Max column number.  (Reinoud van Leeuwen <reinoud.v@n.leeuwen.net>)
Re: Max column number.  (Viktor Bojović <viktor.bojovic@gmail.com>)
List pgsql-sql
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.

pgsql-sql by date:

Previous
From: Viktor Bojović
Date:
Subject: Re: overload
Next
From: Reinoud van Leeuwen
Date:
Subject: Re: Max column number.