Re: Array behavior oddities

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Array behavior oddities
Date: 2008-03-26 14:43:49
Message-ID: 200803261443.m2QEhnM21931@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > If any dimension is written as a slice, i.e. contains a colon, then all
> > dimensions are treated as slices.
>
> > Is the the behavior of assuming an entry with no colon is a slice what
> > we want, or are we just stuck with it?
>
> Why do you find that surprising? It's either a slice or it isn't,
> there's no halfway point. Are you proposing to throw an error if only
> some of the subscripts have colons? What would be the point?
>
> > Is there a reason out-of-bounds array accesses behave differently for
> > slices and non-slices?
>
> History (although "sloppy original implementation" would do too). I'm
> not sure if we should try to clean it up --- there've not been that many
> complaints, but I'm sure we'd get complaints from people whose code
> stopped working, if we change it.

I have updated the documention (patch attached) to be clearer on the odd
array slice behavior.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 1.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zubkovsky, Sergey 2008-03-26 14:44:16 Re: [DOCS] pg_total_relation_size() and CHECKPOINT
Previous Message Tom Lane 2008-03-26 14:40:18 Re: Surfacing qualifiers