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

From Tom Lane
Subject Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Date
Msg-id 9754.1364429095@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Brendan Jurd <direvus@gmail.com>)
Responses Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
Brendan Jurd <direvus@gmail.com> writes:
> On 28 March 2013 09:39, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>> Maybe. But even in 1-D, it's still jumping from having one empty array
>> to infinitely many starting at different indexes, e.g., '{}'::int[] !=
>> '[4:3]={}'::int[]. There may be a certain logic to that, but I'm not
>> convinced about its usefulness.

> We already have the ability to define lower bounds other than 1 on
> arrays, and it would be inconsistent to allow that for arrays with
> elements, but not for arrays without.

Yeah, if '[1:1]={0}'::int[] is distinct from '[2:2]={0}'::int[],
it's a bit hard to argue that '[1:0]={}'::int[] must not be
distinct from '[2:1]={}'::int[].  If we were doing this from scratch
we might drop the whole notion of nondefault lower bounds, but that
ship sailed ages ago.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Brendan Jurd
Date:
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Next
From: Michael Paquier
Date:
Subject: Re: [COMMITTERS] pgsql: Allow external recovery_config_directory