>From 64146f568d1391512ca71257be3ff0c2f676b8cb Mon Sep 17 00:00:00 2001
From: Andres Freund <andres@anarazel.de>
Date: Sat, 21 Feb 2015 13:58:42 +0100
Subject: [PATCH 2/3] fixup! deparse: infrastructure needed for command
 deparsing

Slight cleanup in new_objtree_VA() by treating ObjTypeNull just like the
other types.
---
 src/backend/tcop/deparse_utility.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/backend/tcop/deparse_utility.c b/src/backend/tcop/deparse_utility.c
index d532b79..35c4eca 100644
--- a/src/backend/tcop/deparse_utility.c
+++ b/src/backend/tcop/deparse_utility.c
@@ -196,13 +196,6 @@ new_objtree_VA(char *fmt, int numobjs,...)
 		name = va_arg(args, char *);
 		type = va_arg(args, ObjType);
 
-		/* Null params don't have a value (obviously) */
-		if (type == ObjTypeNull)
-		{
-			append_null_object(tree, name);
-			continue;
-		}
-
 		/*
 		 * For all other param types there must be a value in the varargs.
 		 * Fetch it and add the fully formed subobject into the main object.
@@ -227,8 +220,10 @@ new_objtree_VA(char *fmt, int numobjs,...)
 			case ObjTypeFloat:
 				elem = new_float_object(va_arg(args, double));
 				break;
-			default:
-				elog(ERROR, "invalid parameter type %d", type);
+			case ObjTypeNull:
+				/* Null params don't have a value (obviously) */
+				elem = new_null_object();
+				break;
 		}
 
 		elem->name = name;
-- 
2.3.0.149.gf3f4077.dirty

