Re: Multidimensional array definition in composite type appears parsed as string -- SOLVED - Mailing list pgsql-general

From Tom Lane
Subject Re: Multidimensional array definition in composite type appears parsed as string -- SOLVED
Date
Msg-id 12327.1243530177@sss.pgh.pa.us
Whole thread Raw
In response to Re: Multidimensional array definition in composite type appears parsed as string -- SOLVED  (miller_2555 <nabble.30.miller_2555@spamgourmet.com>)
List pgsql-general
miller_2555 <nabble.30.miller_2555@spamgourmet.com> writes:
> I had assumed that the whole slice of a sub-array would have been returned
> as a 1-D array by accessing an element of the "outer" array, but that does
> not appear the case.

No, it's not.  The semantics are constrained here by the fact that we
don't consider 1-D and 2-D arrays (or any-D arrays) to be distinct
types.  So the parser determines whether the result of a subscript
expression has the element type or the (same) array type based on
whether or not there's a [subscript:subscript] anywhere, not on
how many subscripts there are.

There's been some discussion of tightening things up to throw an
error rather than just returning NULL if an inappropriate number of
subscripts are given, but so far nothing's been done about it.

            regards, tom lane

pgsql-general by date:

Previous
From: "Tim Bruce - Postgres"
Date:
Subject: Re: How to speed up the first-time-searching in pgsql?
Next
From: "Anirban Pal"
Date:
Subject: Re: Postgres registry access using java