Re: Should array_length() Return NULL

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Should array_length() Return NULL
Date: 2013-03-15 22:08:37
Message-ID: E65FC6AF-0A6E-40E3-B4C9-56E9599A6577@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mar 15, 2013, at 3:07 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> The thing is that that syntax creates an array of zero dimensions,
> not one that has 1 dimension and zero elements. So "0" would be
> incorrect.
>
> Our handling of empty arrays leaves something to be desired, I agree,
> but making it more consistent seems like a large task. Hacking
> array_length in isolation will certainly not help.

Oh. Is there a way to declare an empty 1-dimension array?

Thanks,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-03-15 22:36:36 Re: Materialized view assertion failure in HEAD
Previous Message Tom Lane 2013-03-15 22:07:17 Re: Should array_length() Return NULL