Re: Multidimensional array definition in composite type appears parsed as string -- SOLVED

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: miller_2555 <nabble(dot)30(dot)miller_2555(at)spamgourmet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multidimensional array definition in composite type appears parsed as string -- SOLVED
Date: 2009-05-28 17:02:57
Message-ID: 12327.1243530177@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

miller_2555 <nabble(dot)30(dot)miller_2555(at)spamgourmet(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marcos Davi Reis 2009-05-28 17:52:41 PL-Debugger installation problem
Previous Message inf200468 2009-05-28 16:53:47 configurar el hba