Re: [GENERAL] Multi-dimensional arrays

2014-03-15 Thread Tom Lane
Thom Brown writes: > On 15 March 2014 16:21, Tom Lane wrote: >> Postgres does not think of multi-D arrays as being arrays of arrays. >> This is problematic mainly because the SQL standard does think of them >> that way. I'm not sure if there's any hope of changing it though --- >> there's probab

Re: [GENERAL] Multi-dimensional arrays

2014-03-15 Thread Thom Brown
On 15 March 2014 16:21, Tom Lane wrote: > "Raymond O'Donnell" writes: >> True... though that gives you a 2D array, whereas I was hoping for a 1D >> array from (array[...])[1]. > > Postgres does not think of multi-D arrays as being arrays of arrays. > This is problematic mainly because the SQL sta

Re: [GENERAL] Multi-dimensional arrays

2014-03-15 Thread Tom Lane
"Raymond O'Donnell" writes: > On 15/03/2014 14:01, Thom Brown wrote: >> On 15 March 2014 12:51, Raymond O'Donnell wrote: >>> Here's an odd one (to me anyway) which I ran into today if I have a >>> multidimensional array, why does the following return NULL? >>> select (array[['abc','def'], ['g

Re: [GENERAL] Multi-dimensional arrays

2014-03-15 Thread Raymond O'Donnell
On 15/03/2014 14:01, Thom Brown wrote: > On 15 March 2014 12:51, Raymond O'Donnell wrote: >> Hello all, >> >> Here's an odd one (to me anyway) which I ran into today if I have a >> multidimensional array, why does the following return NULL? >> >> select (array[['abc','def'], ['ghi','jkl']]

Re: [GENERAL] Multi-dimensional arrays

2014-03-15 Thread Thom Brown
On 15 March 2014 12:51, Raymond O'Donnell wrote: > Hello all, > > Here's an odd one (to me anyway) which I ran into today if I have a > multidimensional array, why does the following return NULL? > > select (array[['abc','def'], ['ghi','jkl']])[1] > > I would have expected it to return {ab

[GENERAL] Multi-dimensional arrays

2014-03-15 Thread Raymond O'Donnell
Hello all, Here's an odd one (to me anyway) which I ran into today if I have a multidimensional array, why does the following return NULL? select (array[['abc','def'], ['ghi','jkl']])[1] I would have expected it to return {abc, def}. This, however, returns 'abc' as expected: select