diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index f2568ff5e6..1a8df587ce 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -27,8 +27,9 @@
  */
 
 /* Copy a simple scalar field (int, float, bool, enum, etc) */
+/* We now assume that scalar fields are flat-copied via initial memcpy */
 #define COPY_SCALAR_FIELD(fldname) \
-	(newnode->fldname = from->fldname)
+	((void) 0)
 
 /* Copy a field that is a pointer to some kind of Node or Node tree */
 #define COPY_NODE_FIELD(fldname) \
@@ -43,8 +44,9 @@
 	(newnode->fldname = from->fldname ? pstrdup(from->fldname) : (char *) NULL)
 
 /* Copy a field that is an inline array */
+/* These too should be taken care of by initial memcpy */
 #define COPY_ARRAY_FIELD(fldname) \
-	memcpy(newnode->fldname, from->fldname, sizeof(newnode->fldname))
+	((void) 0)
 
 /* Copy a field that is a pointer to a simple palloc'd object of size sz */
 #define COPY_POINTER_FIELD(fldname, sz) \
@@ -59,7 +61,7 @@
 
 /* Copy a parse location field (for Copy, this is same as scalar case) */
 #define COPY_LOCATION_FIELD(fldname) \
-	(newnode->fldname = from->fldname)
+	((void) 0)
 
 
 #include "copyfuncs.funcs.c"
@@ -72,8 +74,9 @@
 static Const *
 _copyConst(const Const *from)
 {
-	Const	   *newnode = makeNode(Const);
+	Const	   *newnode = palloc_object(Const);
 
+	memcpy(newnode, from, sizeof(Const));
 	COPY_SCALAR_FIELD(consttype);
 	COPY_SCALAR_FIELD(consttypmod);
 	COPY_SCALAR_FIELD(constcollid);
@@ -107,8 +110,9 @@ _copyConst(const Const *from)
 static A_Const *
 _copyA_Const(const A_Const *from)
 {
-	A_Const    *newnode = makeNode(A_Const);
+	A_Const    *newnode = palloc_object(A_Const);
 
+	memcpy(newnode, from, sizeof(A_Const));
 	COPY_SCALAR_FIELD(isnull);
 	if (!from->isnull)
 	{
@@ -150,8 +154,10 @@ _copyExtensibleNode(const ExtensibleNode *from)
 	const ExtensibleNodeMethods *methods;
 
 	methods = GetExtensibleNodeMethods(from->extnodename, false);
-	newnode = (ExtensibleNode *) newNode(methods->node_size,
-										 T_ExtensibleNode);
+
+	newnode = (ExtensibleNode *) palloc(methods->node_size);
+	memcpy(newnode, from, methods->node_size);
+
 	COPY_STRING_FIELD(extnodename);
 
 	/* copy the private fields */
diff --git a/src/backend/nodes/gen_node_support.pl b/src/backend/nodes/gen_node_support.pl
index b3c1ead496..4f62fa09cb 100644
--- a/src/backend/nodes/gen_node_support.pl
+++ b/src/backend/nodes/gen_node_support.pl
@@ -671,8 +671,9 @@ foreach my $n (@node_types)
 static $n *
 _copy${n}(const $n *from)
 {
-\t${n} *newnode = makeNode($n);
+\t${n} *newnode = palloc_object($n);
 
+\tmemcpy(newnode, from, sizeof($n));
 " unless $struct_no_copy;
 
 	print $eff "
