Arrange for an explicit cast applied to an ARRAY[] constructor to be applied
Tom Lane <tgl@sss.pgh.pa.us>
Arrange for an explicit cast applied to an ARRAY[] constructor to be applied directly to all the member expressions, instead of the previous implementation where the ARRAY[] constructor would infer a common element type and then we'd coerce the finished array after the fact. This has a number of benefits, one being that we can allow an empty ARRAY[] construct so long as its element type is specified by such a cast. Brendan Jurd, minor fixes by me.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/syntax.sgml | modified | +35 −7 |
| src/backend/nodes/copyfuncs.c | modified | +14 −1 |
| src/backend/nodes/equalfuncs.c | modified | +12 −1 |
| src/backend/nodes/outfuncs.c | modified | +12 −1 |
| src/backend/parser/gram.y | modified | +43 −42 |
| src/backend/parser/parse_expr.c | modified | +167 −40 |
| src/backend/parser/parse_target.c | modified | +2 −2 |
| src/include/nodes/nodes.h | modified | +2 −1 |
| src/include/nodes/parsenodes.h | modified | +13 −4 |
| src/test/regress/expected/arrays.out | modified | +9 −0 |
| src/test/regress/sql/arrays.sql | modified | +2 −0 |