diff options
Diffstat (limited to 'src/bin/pg_rewind/t/001_basic.pl')
-rw-r--r-- | src/bin/pg_rewind/t/001_basic.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bin/pg_rewind/t/001_basic.pl b/src/bin/pg_rewind/t/001_basic.pl index fb4a0acd965..ba528e262f3 100644 --- a/src/bin/pg_rewind/t/001_basic.pl +++ b/src/bin/pg_rewind/t/001_basic.pl @@ -1,7 +1,7 @@ use strict; use warnings; use TestLib; -use Test::More tests => 20; +use Test::More tests => 23; use FindBin; use lib $FindBin::RealBin; @@ -29,6 +29,10 @@ sub run_test primary_psql("CREATE TABLE tail_tbl (id integer, d text)"); primary_psql("INSERT INTO tail_tbl VALUES (0, 'in primary')"); + # This test table is dropped in the old primary after promotion. + primary_psql("CREATE TABLE drop_tbl (d text)"); + primary_psql("INSERT INTO drop_tbl VALUES ('in primary')"); + primary_psql("CHECKPOINT"); RewindTest::create_standby($test_mode); @@ -66,6 +70,9 @@ sub run_test primary_psql("DELETE FROM tail_tbl WHERE id > 10"); primary_psql("VACUUM tail_tbl"); + # Drop drop_tbl. pg_rewind should copy it back. + primary_psql("DROP TABLE drop_tbl"); + # Before running pg_rewind, do a couple of extra tests with several # option combinations. As the code paths taken by those tests # do not change for the "local" and "remote" modes, just run them @@ -154,6 +161,12 @@ in primary, before promotion ), 'tail-copy'); + check_query( + 'SELECT * FROM drop_tbl', + qq(in primary +), + 'drop'); + # Permissions on PGDATA should be default SKIP: { |