From a3415893d8da5254d986566c32832e5407364e7c Mon Sep 17 00:00:00 2001
From: Zhijie Hou <houzj.fnst@fujitsu.com>
Date: Wed, 24 Dec 2025 16:20:27 +0800
Subject: [PATCH v1] Fix regression test failure when wal_level is set to minimal

Commit 67c209 removes the WARNING for insufficient wal_level from the output,
but the WARNING may still appear on BF animals that default to
wal_level=minimal.

To avoid tests that produce varying messages based on wal_level, This commit modifies
the test to use ALTER PUBLICATION for verifying the same behavior, ensuring the
output remains consistent regardless of the wal_level setting.
---
 src/test/regress/expected/publication.out | 8 +++-----
 src/test/regress/sql/publication.sql      | 6 ++----
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out
index 7f81e61d7a7..7fb49aaf29b 100644
--- a/src/test/regress/expected/publication.out
+++ b/src/test/regress/expected/publication.out
@@ -286,9 +286,9 @@ SET client_min_messages = 'ERROR';
 CREATE PUBLICATION regress_pub_for_allsequences_alltables FOR ALL SEQUENCES, ALL TABLES;
 -- Specifying WITH clause in an ALL SEQUENCES publication will emit a NOTICE.
 SET client_min_messages = 'NOTICE';
-CREATE PUBLICATION regress_pub_for_allsequences_alltables_withclause FOR ALL SEQUENCES, ALL TABLES WITH (publish = 'insert');
+ALTER PUBLICATION regress_pub_for_allsequences_alltables SET (publish = 'insert');
 NOTICE:  publication parameters are not applicable to sequence synchronization and will be ignored for sequences
-CREATE PUBLICATION regress_pub_for_allsequences_withclause FOR ALL SEQUENCES WITH (publish_generated_columns = 'stored');
+ALTER PUBLICATION regress_pub_for_allsequences_alltables SET (publish_generated_columns = 'stored');
 NOTICE:  publication parameters are not applicable to sequence synchronization and will be ignored for sequences
 RESET client_min_messages;
 SELECT pubname, puballtables, puballsequences FROM pg_publication WHERE pubname = 'regress_pub_for_allsequences_alltables';
@@ -301,15 +301,13 @@ SELECT pubname, puballtables, puballsequences FROM pg_publication WHERE pubname
                                        Publication regress_pub_for_allsequences_alltables
           Owner           | All tables | All sequences | Inserts | Updates | Deletes | Truncates | Generated columns | Via root 
 --------------------------+------------+---------------+---------+---------+---------+-----------+-------------------+----------
- regress_publication_user | t          | t             | t       | t       | t       | t         | none              | f
+ regress_publication_user | t          | t             | t       | f       | f       | f         | stored            | f
 (1 row)
 
 DROP SEQUENCE regress_pub_seq0, pub_test.regress_pub_seq1;
 DROP PUBLICATION regress_pub_forallsequences1;
 DROP PUBLICATION regress_pub_forallsequences2;
 DROP PUBLICATION regress_pub_for_allsequences_alltables;
-DROP PUBLICATION regress_pub_for_allsequences_alltables_withclause;
-DROP PUBLICATION regress_pub_for_allsequences_withclause;
 -- fail - Specifying ALL TABLES more than once
 CREATE PUBLICATION regress_pub_for_allsequences_alltables FOR ALL SEQUENCES, ALL TABLES, ALL TABLES;
 ERROR:  invalid publication object list
diff --git a/src/test/regress/sql/publication.sql b/src/test/regress/sql/publication.sql
index 00390aecd47..85b00bd67c8 100644
--- a/src/test/regress/sql/publication.sql
+++ b/src/test/regress/sql/publication.sql
@@ -146,8 +146,8 @@ CREATE PUBLICATION regress_pub_for_allsequences_alltables FOR ALL SEQUENCES, ALL
 
 -- Specifying WITH clause in an ALL SEQUENCES publication will emit a NOTICE.
 SET client_min_messages = 'NOTICE';
-CREATE PUBLICATION regress_pub_for_allsequences_alltables_withclause FOR ALL SEQUENCES, ALL TABLES WITH (publish = 'insert');
-CREATE PUBLICATION regress_pub_for_allsequences_withclause FOR ALL SEQUENCES WITH (publish_generated_columns = 'stored');
+ALTER PUBLICATION regress_pub_for_allsequences_alltables SET (publish = 'insert');
+ALTER PUBLICATION regress_pub_for_allsequences_alltables SET (publish_generated_columns = 'stored');
 RESET client_min_messages;
 
 SELECT pubname, puballtables, puballsequences FROM pg_publication WHERE pubname = 'regress_pub_for_allsequences_alltables';
@@ -157,8 +157,6 @@ DROP SEQUENCE regress_pub_seq0, pub_test.regress_pub_seq1;
 DROP PUBLICATION regress_pub_forallsequences1;
 DROP PUBLICATION regress_pub_forallsequences2;
 DROP PUBLICATION regress_pub_for_allsequences_alltables;
-DROP PUBLICATION regress_pub_for_allsequences_alltables_withclause;
-DROP PUBLICATION regress_pub_for_allsequences_withclause;
 
 -- fail - Specifying ALL TABLES more than once
 CREATE PUBLICATION regress_pub_for_allsequences_alltables FOR ALL SEQUENCES, ALL TABLES, ALL TABLES;
-- 
2.31.1

