pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Roman Nowak <roman_nowak@poczta.onet.pl>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #2913: Subscript on multidimensional array yields no value
Date: Tue, 30 Jan 2007 22:44:17 -0500
Message-ID: <14949.1170215057@sss.pgh.pa.us> (raw)
In-Reply-To: <200701310200.l0V20Sd08345@momjian.us>
References: <200701310200.l0V20Sd08345@momjian.us>

Bruce Momjian <bruce@momjian.us> writes:
> Tom Lane wrote:
>> This is not a bug, this is a definitional disagreement, and your TODO
>> entry presupposes an answer that I don't particularly agree with.

> Well, our documentation suggests thaat [1] is the same as [1:1]:
> 	http://www.postgresql.org/docs/8.2/static/arrays.html#AEN5791

It says absolutely no such thing.  A subscript expression involving m:n
produces a "slice", hence an array of different dimensionality from the
original, whereas a subscript expression not involving any colon
produces a single element --- that is, not an array at all.

You could make a fair case that the (ARRAY[[1,2],[3,4]])[1] example
should throw an error instead of returning null.  But to claim it is
the same as a slice expression is a typing violation.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <14949.1170215057@sss.pgh.pa.us>
Permalink:  ../14949.1170215057@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14949.1170215057@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, roman_nowak@poczta.onet.pl, pgsql-bugs@postgresql.org
  Subject: Re: BUG #2913: Subscript on multidimensional array yields no value
  In-Reply-To: <14949.1170215057@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox