From 47aaebaac95c9000549d1a6de809e15b729231f5 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun, 2 Feb 2014 18:59:34 -0500
Subject: [PATCH] Switch in psql_scan() must cover all lexer states (except
 backslash cases).
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Oversight in commit f7559c0101afa33bfb4e104036ca46adac900111, which changed
UESCAPE lexing in psql.  Per bug #9068 from Manuel Gómez.
---
 src/bin/psql/psqlscan.l | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/psql/psqlscan.l b/src/bin/psql/psqlscan.l
index 04c85816fe0..7d61f932fdd 100644
--- a/src/bin/psql/psqlscan.l
+++ b/src/bin/psql/psqlscan.l
@@ -1296,6 +1296,8 @@ psql_scan(PsqlScanState state,
 			{
 				/* This switch must cover all non-slash-command states. */
 				case INITIAL:
+				case xuiend:	/* we treat these like INITIAL */
+				case xusend:
 					if (state->paren_depth > 0)
 					{
 						result = PSCAN_INCOMPLETE;
-- 
GitLab