summaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/t/001_basic.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_rewind/t/001_basic.pl')
-rw-r--r--src/bin/pg_rewind/t/001_basic.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/t/001_basic.pl b/src/bin/pg_rewind/t/001_basic.pl
index 031594e14e6..c7b48255a71 100644
--- a/src/bin/pg_rewind/t/001_basic.pl
+++ b/src/bin/pg_rewind/t/001_basic.pl
@@ -18,6 +18,12 @@ sub run_test
RewindTest::setup_cluster($test_mode);
RewindTest::start_primary();
+ # Create an in-place tablespace with some data on it.
+ primary_psql("CREATE TABLESPACE space_test LOCATION ''");
+ primary_psql("CREATE TABLE space_tbl (d text) TABLESPACE space_test");
+ primary_psql(
+ "INSERT INTO space_tbl VALUES ('in primary, before promotion')");
+
# Create a test table and insert a row in primary.
primary_psql("CREATE TABLE tbl1 (d text)");
primary_psql("INSERT INTO tbl1 VALUES ('in primary')");
@@ -78,6 +84,13 @@ sub run_test
"insert into drop_tbl values ('in primary, after promotion')");
primary_psql("DROP TABLE drop_tbl");
+ # Insert some data in the in-place tablespace for the old primary and
+ # the standby.
+ primary_psql(
+ "INSERT INTO space_tbl VALUES ('in primary, after promotion')");
+ standby_psql(
+ "INSERT INTO space_tbl VALUES ('in standby, after promotion')");
+
# 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
@@ -146,6 +159,13 @@ sub run_test
RewindTest::run_pg_rewind($test_mode);
check_query(
+ 'SELECT * FROM space_tbl ORDER BY d',
+ qq(in primary, before promotion
+in standby, after promotion
+),
+ 'table content');
+
+ check_query(
'SELECT * FROM tbl1',
qq(in primary
in primary, before promotion