3

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 1

5

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.