0

What practical limits are there on the number of fields a Django model can have?

I'm thinking both at the code level, and at the database level (particularly both Sqlite and Postgres). If the specific version of anything is required then let's say we are talking about the latest LTS version (or nearest equivalent) of everything running on Ubuntu Server.

Singletoned
  • 5,089
  • 3
  • 30
  • 32
  • LOL, this sounds like the embryo of a bad idea... https://stackoverflow.com/questions/12606842/what-is-the-maximum-number-of-columns-in-a-postgresql-select-query – Anentropic Jun 13 '22 at 16:38

1 Answers1

1

I think there is no precise number that indicates the limit of maximum fields in a Django model. I believe this is rather database dependent.In SQL the maximum number of columns is 32767. The default setting for SQLITE_MAX_COLUMN is 2000. You can change it at compile time to values as large as 32767.

For more information about the limits of SQL, please follow this link.