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

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Date: 2013-04-02 00:57:12
Message-ID: CADxJZo1rZcJYkVSw=8kDgCO0H_kVJtV9iibg6g-zPt0rWnpoHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2 April 2013 10:59, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Apr 1, 2013 at 6:40 PM, Brendan Jurd <direvus(at)gmail(dot)com> wrote:
>> It is not possible to construct e.g. '[3:2]={}' or '{{}, {}}' in
>> existing applications, so there is no way for that idiom in existing
>> applications to be broken by upgrading. If testing for equality with
>> '{}' works now, it will also work post-upgrade.
>
> Sure, they've probably got to have at least
> some kind of application change before the wheels really start to come
> off, but as soon as some array that's empty but not equal to {} creeps
> into their application by whatever means, they've got trouble.

Constructing an array with nondefault bounds isn't happening by
accident, you'd have to know about, and deliberately make use of, the
obscure '[m:n]={}' syntax for array literals. How is it going to
"creep in"?

I note the total absence of people rending their garments over the
fact that '{foo}' does not equal '[2:2]={foo}'.

Cheers,
BJ

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2013-04-02 01:15:20 Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Previous Message David E. Wheeler 2013-04-02 00:34:43 Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)