Re: array_length of an empty array - Mailing list pgsql-general

From Tom Lane
Subject Re: array_length of an empty array
Date
Msg-id 21633.1343574601@sss.pgh.pa.us
Whole thread Raw
In response to array_length of an empty array  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
John R Pierce <pierce@hogranch.com> writes:
> hmmm.    array[]::integer[]    is an empty array, {}, eg an array with
> zero elements

> but array_length(array[]::integer[])   is NULL rather than zero.    this
> seems counterintuitive.

IIRC, there are a whole bunch of questionable behaviors around empty
arrays.  Somebody should go through the whole list of array-related
functions and come up with a coherent proposal for fixing all of them.

            regards, tom lane

pgsql-general by date:

Previous
From: Ryan Kelly
Date:
Subject: Re: array_length of an empty array
Next
From: Edson Richter
Date:
Subject: Re: Enums documentation "glitch"