Re: [SQL] Array Madness

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Richards <miker(at)scifair(dot)acadiau(dot)ca>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Array Madness
Date: 1999-09-14 15:02:13
Message-ID: 16388.937321333@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Michael Richards <miker(at)scifair(dot)acadiau(dot)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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Richards 1999-09-14 15:42:53 Re: [SQL] Array Madness
Previous Message Stuart Rison 1999-09-14 11:02:23 Re: [GENERAL] Getting multiple field unique index to distinguish NULLs.