The hidden cost of PostgreSQL arrays

Starting with arrays in PostgreSQL is as simple as declaring a column as integer[] , inserting some values, and you are done. Or building the array on the fly. SELECT '{1,2,3}' :: int []; SELECT array [1,2,3]; int4 --------- {1,2,3} (1 row) array --------- {1,2,3} (1 row) The official documentation provides a good introduction. But beneath this straightforward interface lies a set of more complex…