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

From Pollard, Mike
Subject Re: Supporting NULL elements in arrays
Date
Msg-id 6418CC03D0FB1943A464E1FEFB3ED46B01B22092@im01.cincom.com
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  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> and so 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:

Can you use a default to allow the user to specify the default value for
an element?  May look a little strange, though, if the user specifies a
default array and a default element value, like:

CREATE TABLE ARR(ARR CHAR(30)[] DEFAULT '{"hello", "good bye"}' NULL);

So the first default is the array default; specify NULL if you don't
want one but do want an array element default; the second, if present,
is the array element default.  I'm not sure I like this or not, but it's
an idea.

Mike Pollard
SUPRA Server SQL Engineering and Support
Cincom Systems, Inc




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Enums again
Next
From: Jaime Casanova
Date:
Subject: Re: plperl error when making 8.2dev CVS