Re: [SQL] Array Madness - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] Array Madness
Date
Msg-id 16388.937321333@sss.pgh.pa.us
Whole thread Raw
In response to Array Madness  (Michael Richards <miker@scifair.acadiau.ca>)
Responses Re: [SQL] Array Madness  (Michael Richards <miker@scifair.acadiau.ca>)
List pgsql-sql
Michael Richards <miker@scifair.acadiau.ca> writes:
> It seems that you can't have a NULL value in an array.

Seems like a reasonable idea.  Go for it...

> Running an update and setting a single array value to null seems
> to nuke the entire array.

Yeah, it does, see ExecEvalArrayRef() in execQual.c: if the refassgnexpr
yields a null, it just drops out with a null result for the whole expr.
This could be fixed if the array routines had a representation for a
null element in an array, but they don't.

In the meantime, perhaps it would be better for ExecEvalArrayRef() to
raise an error if the assign source is null, rather than dropping the
whole contents of the array.  Comments?
        regards, tom lane


pgsql-sql by date:

Previous
From: raptor
Date:
Subject: Long story !!! Please HELP !!!
Next
From: Michael Richards
Date:
Subject: Re: [SQL] Array Madness