aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2021-12-30 16:09:53 +1300
committerThomas Munro <tmunro@postgresql.org>2021-12-30 17:14:49 +1300
commitf7d7ac23d19240a90bbb8d91cb231ef7f883dd02 (patch)
tree6396bd1186fc1881ff32394a80eb54e4e522f7b8 /src
parent2ff209953e0a7b4ce9df1c1ba15783345ef5659f (diff)
downloadpostgresql-f7d7ac23d19240a90bbb8d91cb231ef7f883dd02.tar.gz
postgresql-f7d7ac23d19240a90bbb8d91cb231ef7f883dd02.zip
Fix overly generic name in with.sql test.
Avoid the name "test". In the 10 branch, this could clash with alter_table.sql, as seen in the build farm. That other instance was already renamed in later branches by commit 2cf8c7aa, but it's good to future-proof the name here too. Back-patch to 10. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKGJf4RAXUyAYVUcQawcptX%3DnhEco3SYpuPK5cCbA-F1eLA%40mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/with.out16
-rw-r--r--src/test/regress/sql/with.sql10
2 files changed, 13 insertions, 13 deletions
diff --git a/src/test/regress/expected/with.out b/src/test/regress/expected/with.out
index 8aafacaf7c3..d17da5c32ad 100644
--- a/src/test/regress/expected/with.out
+++ b/src/test/regress/expected/with.out
@@ -3118,19 +3118,19 @@ with ordinality as (select 1 as x) select * from ordinality;
(1 row)
-- check sane response to attempt to modify CTE relation
-WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
-ERROR: relation "test" does not exist
-LINE 1: WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
- ^
+WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
+ERROR: relation "with_test" does not exist
+LINE 1: WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (...
+ ^
-- check response to attempt to modify table with same name as a CTE (perhaps
-- surprisingly it works, because CTEs don't hide tables from data-modifying
-- statements)
-create temp table test (i int);
-with test as (select 42) insert into test select * from test;
-select * from test;
+create temp table with_test (i int);
+with with_test as (select 42) insert into with_test select * from with_test;
+select * from with_test;
i
----
42
(1 row)
-drop table test;
+drop table with_test;
diff --git a/src/test/regress/sql/with.sql b/src/test/regress/sql/with.sql
index 2bd049a7615..2b99e43a0b2 100644
--- a/src/test/regress/sql/with.sql
+++ b/src/test/regress/sql/with.sql
@@ -1451,12 +1451,12 @@ create table foo (with ordinality); -- fail, WITH is a reserved word
with ordinality as (select 1 as x) select * from ordinality;
-- check sane response to attempt to modify CTE relation
-WITH test AS (SELECT 42) INSERT INTO test VALUES (1);
+WITH with_test AS (SELECT 42) INSERT INTO with_test VALUES (1);
-- check response to attempt to modify table with same name as a CTE (perhaps
-- surprisingly it works, because CTEs don't hide tables from data-modifying
-- statements)
-create temp table test (i int);
-with test as (select 42) insert into test select * from test;
-select * from test;
-drop table test;
+create temp table with_test (i int);
+with with_test as (select 42) insert into with_test select * from with_test;
+select * from with_test;
+drop table with_test;