On 2023-05-15 19:16, Tom Lane wrote:
Marina Polyakova <m.polyak...@postgrespro.ru> writes:
IIUC the conflict was caused by

+SET search_path to public, test_ns_schema_1;
+CREATE SCHEMA test_ns_schema_2
+       CREATE VIEW abc_view AS SELECT a FROM abc;

because the parallel regression test transactions had already created
the table abc and was trying to drop it.

Hmm.  I'd actually fix the blame on transactions.sql here.  Creating
a table named as generically as "abc" is horribly bad practice in
a set of concurrent tests.  namespace.sql is arguably okay, since
it's creating that table name in a private schema.

I'd be inclined to fix this by doing s/abc/something-else/g in
transactions.sql.

                        regards, tom lane

Maybe use a separate schema for all new objects in the transaction test?.. See diff_set_tx_schema.patch.

--
Marina Polyakova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
diff --git a/src/test/regress/expected/transactions.out b/src/test/regress/expected/transactions.out
index 2b2cff7d9120a139532d1a6a2f2bc79e463bc4fa..6a3758bafb54327fbe341dfd89457e53ffce47dd 100644
--- a/src/test/regress/expected/transactions.out
+++ b/src/test/regress/expected/transactions.out
@@ -1,6 +1,10 @@
 --
 -- TRANSACTIONS
 --
+-- Use your schema to avoid conflicts with objects with the same names in
+-- parallel tests.
+CREATE SCHEMA test_tx_schema;
+SET search_path TO test_tx_schema,public;
 BEGIN;
 CREATE TABLE xacttest (a smallint, b real);
 INSERT INTO xacttest VALUES
diff --git a/src/test/regress/sql/transactions.sql b/src/test/regress/sql/transactions.sql
index 7ee5f6aaa55a686f5484664c3fae224c08bde42a..0e6d6453edaa776425524d43abf5ae3cfca3ac45 100644
--- a/src/test/regress/sql/transactions.sql
+++ b/src/test/regress/sql/transactions.sql
@@ -2,6 +2,11 @@
 -- TRANSACTIONS
 --
 
+-- Use your schema to avoid conflicts with objects with the same names in
+-- parallel tests.
+CREATE SCHEMA test_tx_schema;
+SET search_path TO test_tx_schema,public;
+
 BEGIN;
 
 CREATE TABLE xacttest (a smallint, b real);

Reply via email to