Re: how to add more than 1600 columns in a table?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how to add more than 1600 columns in a table?
Дата
Msg-id 14348.1556137626@sss.pgh.pa.us
обсуждение исходный текст
Ответ на how to add more than 1600 columns in a table?  (pabloa98 <pabloa98@gmail.com>)
Ответы Re: how to add more than 1600 columns in a table?  (pabloa98 <pabloa98@gmail.com>)
Список pgsql-general
pabloa98 <pabloa98@gmail.com> writes:
> Sadly today we hit the 1600 columns limit of Postgresql 11.
> How could we add more columns?

You can't, at least not without some pretty fundamental changes;
that value is limited by field sizes within tuple headers.  You'd
also, more than likely, find yourself hitting problems with the
tuples-can't-cross-page-boundary restrictions.  (Our TOAST mechanism
avoids that problem for large individual fields, but not for many small
fields.)

It seems pretty unlikely to me that any sane table design actually
has thousands of truly-independent columns.  Consider using arrays,
or perhaps composite sub-structures (JSON maybe?).

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Re: how to add more than 1600 columns in a table?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: how to add more than 1600 columns in a table?