SQLSTATE 54011 ERROR Class 54: Program Limit Exceeded

too_many_columns tables can have at most 1600 columns — 54011

PostgreSQL error “tables can have at most 1600 columns — 54011” (SQLSTATE 54011): what it means, common causes, and how to fix it.

PG 9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed Jun 2026 Grounded in source

Diagnostic Queries

Symptoms

A table definition exceeded PostgreSQL’s hard limit on the number of columns. PostgreSQL raises SQLSTATE 54011 (too_many_columns).

  • A CREATE/ALTER TABLE pushed past the column cap.
  • The effective limit is 1600 (often fewer for wide types).
  • Common with extremely wide, denormalized tables.

What the server log shows

ERROR:  tables can have at most 1600 columns

Why PostgreSQL raises this — what the manual says

Appendix K PostgreSQL Limitations:

“Columns that have been dropped from the table also contribute to the maximum column limit.”

Each row must fit page/tuple constraints, capping columns at 1600 (fewer for wide types). A definition exceeding the cap can’t be stored, so PostgreSQL reports 54011.

Common causes

  • An over-denormalized table with too many columns.
  • Repeatedly adding columns to a very wide table.
  • Generated/EAV-style schemas creating excessive columns.

How to fix it

  1. Normalize: split the table into related tables.
  2. Use JSONB or arrays for sparse/variable attributes instead of many columns.
  3. Reconsider the schema design to stay well under the limit.

Related & next steps

Reference: PostgreSQL 18 Appendix K “Limits”.

Was this helpful?