Peter Krauss <ppkrauss@gmail.com> writes: > I need to access an array-item from an array of arrays.
Multi-dimensional arrays in Postgres are not "arrays of arrays".
Thanks, you expressed in a little phrase something fundamental to think about pg-arrays (!), the pg-Guide need some notices like yours, to remember people like me ;-) Well... The good answer closes the question.
- - - -
We can imagine that the "multidimensional array world" is like a data type, that is distinct from the "usual array" data type...
I am starting other discussion...
Let me explain how the question arrives for me: was after working with JSONB, where arrays are of "usual array" type.
Now that PostgreSQL 9.4+ incorporated definitely JSONB, the SQL array data type is an important "intermediate" between JSONB and usual SQL structures (and type operation algebras).
So, perhaps, PostgreSQL 9.4+ will need a kind of "usual array type", a new internal type, and a cast function: with this new type will be possible to simplify the work with JSONB, and do other things like array_agg(array[x,y]).
... It is not for final user, perhaps only for developers, or library plugins: an "intermediate" type that not broken compatibility... Not very useful, a type only to formally express things like to eficient cast, etc.