As I known about the relational database, records are stored with the same size. However, array datatype in PostgreSQL is flexible in size. So how PostgreSQL actually store Array datatype? Do it store the pointer of the array to the record and store the value somewhere else?
1 Answer
In PostgreSQL (and other databases I am aware of) rows do not have a fixed size.
Arrays are stored like all other values of a type with variable size: if the row threatens to exceed 2000 bytes, the TOAST machinery will first compress such values, and if that is not enough, store them out of line in a TOAST table.
See the documentation for details.