diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index a10e852f77d..102e64902f9 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -1953,14 +1953,17 @@ static char *
 replaceVariable(char **sql, char *param, int len, char *value, PsqlScanQuoteType quote, PGconn *conn)
 {
 	int			valueln;
-	char		quotechar;
-	char	   *quoted_value;
+	char	   *quoted_value	=	NULL;
 
 	switch (quote)
 	{
 		case PQUOTE_PLAIN:
 			quoted_value = pg_strdup(value);
 			break;
+		case PQUOTE_SHELL_ARG:
+			quoted_value = pg_strdup(value);
+			break;
+
 		case PQUOTE_SQL_LITERAL:
 		case PQUOTE_SQL_IDENT:
 			{
@@ -1995,7 +1998,11 @@ replaceVariable(char **sql, char *param, int len, char *value, PsqlScanQuoteType
 				break;
 			}
 	}
-
+	if (quoted_value == NULL)
+	{
+		pg_log_error("unhandled quoting case");
+		exit(1);
+	}
 	valueln = strlen(quoted_value);
 
 	if (valueln > len)
