Re: Are arrays broken in 7.0.3?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jason Aten <jaten(at)CS(dot)UCLA(dot)EDU>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Are arrays broken in 7.0.3?
Date: 2000-12-18 22:08:04
Message-ID: 1951.977177284@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jason Aten <jaten(at)CS(dot)UCLA(dot)EDU> writes:
> testdb=# select f[2][1:5] from arr; (ask row back, get two!)

This is implicitly an array slice operation, so it's the same as
select f[1:2][1:5] from arr;
If you want just the one row you need to write
select f[2:2][1:5] from arr;

The behavior of the cases with too few subscripts does seem pretty
unhelpful --- seems like either raising an error or returning a
slice would make more sense than returning NULL. But that's how
the code is set up at the moment.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Aten 2000-12-18 22:15:30 Re: Are arrays broken in 7.0.3?
Previous Message Adam Lang 2000-12-18 22:06:34 Re: a "huge" table with small rows and culumns