aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-03-20 21:42:48 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-03-20 21:42:48 +0000
commit6b0706ac33ab5da815980c642a9cde9a4cd86b6b (patch)
tree511ad4743ad55a095cbacea0713b437af36ba9ce /src/backend/nodes/copyfuncs.c
parent8759b79d0fe8b9937b7cbebfed78480b3e6a94b2 (diff)
downloadpostgresql-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/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index e9df49bab9c..d9432532666 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.388 2008/02/07 20:19:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.389 2008/03/20 21:42:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1684,6 +1684,16 @@ _copyA_Indirection(A_Indirection *from)
return newnode;
}
+static A_ArrayExpr *
+_copyA_ArrayExpr(A_ArrayExpr *from)
+{
+ A_ArrayExpr *newnode = makeNode(A_ArrayExpr);
+
+ COPY_NODE_FIELD(elements);
+
+ return newnode;
+}
+
static ResTarget *
_copyResTarget(ResTarget *from)
{
@@ -3543,6 +3553,9 @@ copyObject(void *from)
case T_A_Indirection:
retval = _copyA_Indirection(from);
break;
+ case T_A_ArrayExpr:
+ retval = _copyA_ArrayExpr(from);
+ break;
case T_ResTarget:
retval = _copyResTarget(from);
break;