summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/with.out8
-rw-r--r--src/test/regress/sql/with.sql7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/test/regress/expected/with.out b/src/test/regress/expected/with.out
index 7a51e2eb757..26c88505140 100644
--- a/src/test/regress/expected/with.out
+++ b/src/test/regress/expected/with.out
@@ -2104,6 +2104,14 @@ WITH RECURSIVE x(n) AS (
ERROR: ORDER BY in a recursive query is not implemented
LINE 3: ORDER BY (SELECT n FROM x))
^
+-- and this
+WITH RECURSIVE x(n) AS (
+ WITH sub_cte AS (SELECT * FROM x)
+ DELETE FROM graph RETURNING f)
+ SELECT * FROM x;
+ERROR: recursive query "x" must not contain data-modifying statements
+LINE 1: WITH RECURSIVE x(n) AS (
+ ^
CREATE TEMPORARY TABLE y (a INTEGER);
INSERT INTO y SELECT generate_series(1, 10);
-- LEFT JOIN
diff --git a/src/test/regress/sql/with.sql b/src/test/regress/sql/with.sql
index dcdaab5eff0..b1cae161290 100644
--- a/src/test/regress/sql/with.sql
+++ b/src/test/regress/sql/with.sql
@@ -963,6 +963,13 @@ WITH RECURSIVE x(n) AS (
ORDER BY (SELECT n FROM x))
SELECT * FROM x;
+-- and this
+WITH RECURSIVE x(n) AS (
+ WITH sub_cte AS (SELECT * FROM x)
+ DELETE FROM graph RETURNING f)
+ SELECT * FROM x;
+
+
CREATE TEMPORARY TABLE y (a INTEGER);
INSERT INTO y SELECT generate_series(1, 10);