From d8a5608d4ac9d4b74772980666cc6626bd18c3ff Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Tue, 10 Sep 2013 19:36:10 -0400
Subject: [PATCH] psql: fix \copy stdin trailing space requirement

Previously a trailing space was required for \copy ... stdin:

	copy foo from stdin ;

Etsuro Fujita
---
 src/bin/psql/copy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c
index c1e7cfeb8af..13123d600db 100644
--- a/src/bin/psql/copy.c
+++ b/src/bin/psql/copy.c
@@ -196,7 +196,7 @@ parse_slash_copy(const char *args)
 		goto error;
 
 	/* { 'filename' | PROGRAM 'command' | STDIN | STDOUT | PSTDIN | PSTDOUT } */
-	token = strtokx(NULL, whitespace, NULL, "'",
+	token = strtokx(NULL, whitespace, ";", "'",
 					0, false, false, pset.encoding);
 	if (!token)
 		goto error;
@@ -205,7 +205,7 @@ parse_slash_copy(const char *args)
 	{
 		int			toklen;
 
-		token = strtokx(NULL, whitespace, NULL, "'",
+		token = strtokx(NULL, whitespace, ";", "'",
 						0, false, false, pset.encoding);
 		if (!token)
 			goto error;
-- 
GitLab