Re: Supporting NULL elements in arrays - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Supporting NULL elements in arrays
Date
Msg-id 10097.1131495694@sss.pgh.pa.us
Whole thread Raw
In response to Supporting NULL elements in arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Supporting NULL elements in arrays
Re: Supporting NULL elements in arrays
List pgsql-hackers
I wrote:
> ... the most straightforward thing to do is define an empty element
> as meaning a NULL.  But this might be objected to on a couple of grounds:

I just thought of another, potentially fatal objection: it's ambiguous
whether '{}'::text[] should be taken to mean an empty (zero-length)
array or an array containing a single NULL element.

For backwards compatibility it should mean an empty array, but then
there's no way to represent ARRAY(NULL) in data dumps, which won't
do either.

The only workaround that comes to mind is to allow explicit
specification of what's meant:  '[1:1]{}' would be needed to represent
the one-null case.  Ugly.

Ideas anyone?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Interval aggregate regression failure (expected seems
Next
From: "Jim C. Nasby"
Date:
Subject: Re: DTrace?