Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Date: 2013-04-02 04:23:42
Message-ID: CAFj8pRDom34B-FsRh=0NfDuQ_MKxMiyxGzM4ndH1Omk83koy7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

2013/4/2 Brendan Jurd <direvus(at)gmail(dot)com>

> On 2 April 2013 11:34, David E. Wheeler <david(at)kineticode(dot)com> wrote:
> > On Apr 1, 2013, at 4:59 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> >
> >> I think the only people for whom nothing will break are the people who
> >> aren't using arrays in the first place. Anyone who is is likely to
> >> have dependencies on the way array_lower/upper work today.
> >
> > Well, what if we add new functions that return 0 for empty arrays, but
> leave the existing ones alone? Perhaps call them array_size(),
> array_first_index(), and array_last_index(). Then nothing has to break, and
> we can decide independently if we want to deprecate the older functions in
> a future release. Or not.
>
> I think having an 'array_size' and an 'array_length' that behave
> differently would be legitimately confusing, and I can't think of any
> alternative function name that would concisely explain the difference
> in behaviour -- 'array_length_without_the_stupid_nulls' is just too
> long.
>

yes,

we should to do complete redesign or do nothing.

Regards

Pavel

>
> Cheers,
> BJ
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-04-02 04:24:33 Re: Spin Lock sleep resolution
Previous Message Jeff Janes 2013-04-02 03:07:40 Spin Lock sleep resolution