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

From Jim C. Nasby
Subject Re: Supporting NULL elements in arrays
Date
Msg-id 20051109010221.GH19551@pervasive.com
Whole thread Raw
In response to Re: Supporting NULL elements in arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Supporting NULL elements in arrays
List pgsql-hackers
On Tue, Nov 08, 2005 at 07:21:34PM -0500, Tom Lane wrote:
> 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.

Instead of bending over backwards to try and support older cases, would
a compatability mode be possible? Seems that would solve a lot of
problems.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: mark@mark.mielke.cc
Date:
Subject: Re: Supporting NULL elements in arrays
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Enums again