diff options
| author | Amit Kapila <akapila@postgresql.org> | 2025-10-27 03:52:39 +0000 |
|---|---|---|
| committer | Amit Kapila <akapila@postgresql.org> | 2025-10-27 03:52:39 +0000 |
| commit | 549d9c91b1d2fa38e374c020eb584e3e6836e27c (patch) | |
| tree | cfb760ed04ae47d85c55ef86cedf42b5e9feebe8 /src | |
| parent | 371a302eecdc82274b0ae2967d18fd726a0aa6a1 (diff) | |
Improve test in 009_matviews.pl.
Ensure that the target table on the subscriber exists before executing any
DML intended for replication.
Currently, if the table is missing, the replication logic keeps retrying
until the table is eventually created by the test. Although this behaviour
does not cause test failures, since the table is created after the INSERT
is published and replication eventually succeeds, however, it introduces
unnecessary looping and delays.
Author: Grem Snoort <grem.snoort@gmail.com>
Discussion: https://postgr.es/m/CANV9Qw5HD7=Fp4nox2O7DoVctHoabRRVW9Soo4A=QipqW5B=Tg@mail.gmail.com
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/subscription/t/009_matviews.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/subscription/t/009_matviews.pl b/src/test/subscription/t/009_matviews.pl index 9316fd1bb6d..2389680af13 100644 --- a/src/test/subscription/t/009_matviews.pl +++ b/src/test/subscription/t/009_matviews.pl @@ -19,19 +19,19 @@ $node_subscriber->start; my $publisher_connstr = $node_publisher->connstr . ' dbname=postgres'; $node_publisher->safe_psql('postgres', + q{CREATE TABLE test1 (a int PRIMARY KEY, b text)}); +$node_subscriber->safe_psql('postgres', + q{CREATE TABLE test1 (a int PRIMARY KEY, b text);}); + +$node_publisher->safe_psql('postgres', "CREATE PUBLICATION mypub FOR ALL TABLES;"); $node_subscriber->safe_psql('postgres', "CREATE SUBSCRIPTION mysub CONNECTION '$publisher_connstr' PUBLICATION mypub;" ); $node_publisher->safe_psql('postgres', - q{CREATE TABLE test1 (a int PRIMARY KEY, b text)}); -$node_publisher->safe_psql('postgres', q{INSERT INTO test1 (a, b) VALUES (1, 'one'), (2, 'two');}); -$node_subscriber->safe_psql('postgres', - q{CREATE TABLE test1 (a int PRIMARY KEY, b text);}); - $node_publisher->wait_for_catchup('mysub'); # Materialized views are not supported by logical replication, but |
