diff options
| author | Noah Misch | 2021-01-30 08:11:38 +0000 |
|---|---|---|
| committer | Noah Misch | 2021-01-30 08:11:38 +0000 |
| commit | 360bd2321b1ad9c47466bc485ee5eb2f4515372e (patch) | |
| tree | f8b6d8bc82dd72abed0c8beb50b9777cb5b5762d /src/test/subscription | |
| parent | 8a54e12a38d1545d249f1402f66c8cde2837d97c (diff) | |
Fix error with CREATE PUBLICATION, wal_level=minimal, and new tables.
CREATE PUBLICATION has failed spuriously when applied to a permanent
relation created or rewritten in the current transaction. Make the same
change to another site having the same semantic intent; the second
instance has no user-visible consequences. Back-patch to v13, where
commit c6b92041d38512a4176ed76ad06f713d2e6c01a8 broke this.
Kyotaro Horiguchi
Discussion: https://postgr.es/m/20210113.160705.2225256954956139776.horikyota.ntt@gmail.com
Diffstat (limited to 'src/test/subscription')
| -rw-r--r-- | src/test/subscription/t/001_rep_changes.pl | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl index c20fadcb0e3..04635e93e99 100644 --- a/src/test/subscription/t/001_rep_changes.pl +++ b/src/test/subscription/t/001_rep_changes.pl @@ -3,7 +3,7 @@ use strict; use warnings; use PostgresNode; use TestLib; -use Test::More tests => 27; +use Test::More tests => 28; # Initialize publisher node my $node_publisher = get_new_node('publisher'); @@ -451,3 +451,21 @@ is($result, qq(0), 'check replication origin was dropped on subscriber'); $node_subscriber->stop('fast'); $node_publisher->stop('fast'); + +# CREATE PUBLICATION while wal_level=minimal should succeed, with a WARNING +$node_publisher->append_conf( + 'postgresql.conf', qq( +wal_level=minimal +max_wal_senders=0 +)); +$node_publisher->start; +($result, my $retout, my $reterr) = $node_publisher->psql( + 'postgres', qq{ +BEGIN; +CREATE TABLE skip_wal(); +CREATE PUBLICATION tap_pub2 FOR TABLE skip_wal; +ROLLBACK; +}); +ok( $reterr =~ + m/WARNING: wal_level is insufficient to publish logical changes/, + 'CREATE PUBLICATION while wal_level=minimal'); |
