size/length limitation of array type in PostgreSQL

There is no size limit on Postgres arrays. There must be limits on row or column size, but that would run in the millions of entries.

A more SQL way to relate term to document is a 1 to many relation. This is implemented like:

table term: columns term_id, term, document_id
table document: columns document_id, summary, ...

The document_id column in the term table is called a foreign key.


I didn't find any limitation in number of elements in array, but there is in field size. Maximum size of field in PostgreSQL is 1GB, so it is approximately 268435456 elements in array. Be aware that indexing such array or searching through it would probably be useless.