1

Possible Duplicate:
What is the maximum number of columns in a PostgreSQL select query

I am going to start a new project which requires a large number of tables and columns , using postgres I just want to ask that is number of columns in creating postgres tables are limited , If yes then what would be the MAX value for number of columns in CREATE and SELECT statements?

Community
  • 1
  • 1
Satish Sharma
  • 3,284
  • 9
  • 38
  • 51

1 Answers1

7

Since Postgres 12, the official list of limitations can be found in the manual:

Item                    Upper Limit             Comment
---------------------------------------------------------
database size           unlimited     
number of databases     4,294,950,911     
relations per database  1,431,650,303     
relation size           32 TB                   with the default BLCKSZ of 8192 bytes
rows per table          limited by the number of
                        tuples that can fit onto 4,294,967,295 pages     
columns per table       1600                    further limited by tuple size fitting on a single page; see note below
field size              1 GB     
identifier length       63 bytes                can be increased by recompiling PostgreSQL
indexes per table       unlimited               constrained by maximum relations per database
columns per index       32                      can be increased by recompiling PostgreSQL
partition keys          32                      can be increased by recompiling PostgreSQL

Before that, there was an official list on the PostgresL "About" page. Quote for Postgres 9.5:

Limit                       Value
Maximum Database Size       Unlimited
Maximum Table Size          32 TB
Maximum Row Size            1.6 TB
Maximum Field Size          1 GB
Maximum Rows per Table      Unlimited
Maximum Columns per Table   250 - 1600 depending on column types
Maximum Indexes per Table   Unlimited

If you get anywhere close to those limits, chances are you are doing something wrong.

Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228