4 use Test::More tests => 4;
10 my $test_mode = shift;
12 RewindTest::init_rewind_test('databases', $test_mode);
13 RewindTest::setup_cluster();
15 # Create a database in master.
16 master_psql('CREATE DATABASE inmaster');
18 RewindTest::create_standby();
20 # Create another database, the creation is replicated to the standby
21 master_psql('CREATE DATABASE beforepromotion');
23 RewindTest::promote_standby();
25 # Create databases in the old master and the new promoted standby.
26 master_psql('CREATE DATABASE master_afterpromotion');
27 standby_psql('CREATE DATABASE standby_afterpromotion');
28 # The clusters are now diverged.
30 RewindTest::run_pg_rewind($test_mode);
32 # Check that the correct databases are present after pg_rewind.
33 check_query('SELECT datname FROM pg_database',
39 standby_afterpromotion
45 # Run the test in both modes.