diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-20 21:42:48 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-20 21:42:48 +0000 |
commit | 6b0706ac33ab5da815980c642a9cde9a4cd86b6b (patch) | |
tree | 511ad4743ad55a095cbacea0713b437af36ba9ce /src/backend/nodes/outfuncs.c | |
parent | 8759b79d0fe8b9937b7cbebfed78480b3e6a94b2 (diff) | |
download | postgresql-6b0706ac33ab5da815980c642a9cde9a4cd86b6b.tar.gz postgresql-6b0706ac33ab5da815980c642a9cde9a4cd86b6b.zip |
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.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index c54cbc9d024..ceb0eb607b7 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.322 2008/01/09 08:46:44 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.323 2008/03/20 21:42:48 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -1972,6 +1972,14 @@ _outA_Indirection(StringInfo str, A_Indirection *node) } static void +_outA_ArrayExpr(StringInfo str, A_ArrayExpr *node) +{ + WRITE_NODE_TYPE("A_ARRAYEXPR"); + + WRITE_NODE_FIELD(elements); +} + +static void _outResTarget(StringInfo str, ResTarget *node) { WRITE_NODE_TYPE("RESTARGET"); @@ -2417,6 +2425,9 @@ _outNode(StringInfo str, void *obj) case T_A_Indirection: _outA_Indirection(str, obj); break; + case T_A_ArrayExpr: + _outA_ArrayExpr(str, obj); + break; case T_ResTarget: _outResTarget(str, obj); break; |