Re: Should array_length() Return NULL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Should array_length() Return NULL
Date
Msg-id 24455.1363457979@sss.pgh.pa.us
Whole thread Raw
In response to Re: Should array_length() Return NULL  (Brendan Jurd <direvus@gmail.com>)
Responses Re: Should array_length() Return NULL  ("David E. Wheeler" <david@justatheory.com>)
Re: Should array_length() Return NULL  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Should array_length() Return NULL  (Brendan Jurd <direvus@gmail.com>)
List pgsql-hackers
Brendan Jurd <direvus@gmail.com> writes:
> On 16 March 2013 09:07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The thing is that that syntax creates an array of zero dimensions,
>> not one that has 1 dimension and zero elements.

> I'm going to ask the question that immediately comes to mind: Is there
> anything good at all about being able to define a zero-dimensional
> array?

Perhaps not.  I think for most uses, a 1-D zero-length array would be
just as good.  I guess what I'd want to know is whether we also need
to support higher-dimensional zero-size arrays, and if so, what does
the I/O syntax for those look like?

Another fly in the ointment is that if we do redefine '{}' as meaning
something other than a zero-D array, how will we handle existing
database entries that are zero-D arrays?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strange Windows problem, lock_timeout test request
Next
From: "David E. Wheeler"
Date:
Subject: Re: Should array_length() Return NULL