Require that array literals produce "rectangular" arrays, i.e. all the
Joe Conway <mail@joeconway.com>
Require that array literals produce "rectangular" arrays, i.e. all the subarrays of a given dimension have the same number of elements/subarrays. Also repair a longstanding undocumented (as far as I can see) ability to explicitly set array bounds in the array literal syntax. It now can deal properly with negative array indicies. Modify array_out so that arrays with non-standard lower bounds (i.e. not 1) are output with the expicit dimension syntax. This fixes a longstanding issue whereby arrays with non-default lower bounds had them changed to default after a dump/reload cycle. Modify regression tests and docs to suit, and add some minimal documentation regarding the explicit dimension syntax.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/array.sgml | modified | +70 −45 |
| src/backend/utils/adt/arrayfuncs.c | modified | +88 −9 |
| src/test/regress/expected/arrays.out | modified | +17 −17 |
| src/test/regress/expected/domain.out | modified | +13 −13 |
| src/test/regress/sql/domain.sql | modified | +5 −5 |