Allow assignment to array elements not contiguous with those already
Tom Lane <tgl@sss.pgh.pa.us>
Allow assignment to array elements not contiguous with those already present; intervening positions are filled with nulls. This behavior is required by SQL99 but was not implementable before 8.2 due to lack of support for nulls in arrays. I have only made it work for the one-dimensional case, which is all that SQL99 requires. It seems quite complex to get it right in higher dimensions, and since we never allowed extension at all in higher dimensions, I think that must count as a future feature addition not a bug fix.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/array.sgml | modified | +7 −6 |
| src/backend/utils/adt/arrayfuncs.c | modified | +114 −85 |
| src/test/regress/expected/arrays.out | modified | +110 −0 |
| src/test/regress/sql/arrays.sql | modified | +36 −0 |