From 8d84514c4ddce412ef8cfa5296109bb223047f9c Mon Sep 17 00:00:00 2001
From: Jakub Wartak <jakub.wartak@enterprisedb.com>
Date: Wed, 4 Jan 2023 12:57:58 +0100
Subject: [PATCH] psql: allow CTE queries to be executed also using cursor

---
 src/bin/psql/common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index f5909f9547..9428f4fd75 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -2228,6 +2228,9 @@ is_select_command(const char *query)
 	if (wordlen == 6 && pg_strncasecmp(query, "values", 6) == 0)
 		return true;
 
+	if (wordlen == 4 && pg_strncasecmp(query, "with", 4) == 0)
+		return true;
+
 	return false;
 }
 
-- 
2.30.2

