PS_NITPICKS_20240801_gencols_v220001.txt
text/plain
Filename: PS_NITPICKS_20240801_gencols_v220001.txt
Type: text/plain
Part: 0
diff --git a/src/test/subscription/t/011_generated.pl b/src/test/subscription/t/011_generated.pl
index 05b83f6..504714a 100644
--- a/src/test/subscription/t/011_generated.pl
+++ b/src/test/subscription/t/011_generated.pl
@@ -34,59 +34,60 @@ $node_subscriber->safe_psql('postgres',
"CREATE TABLE tab1 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 22) STORED, c int)"
);
+# tab_gen_to_gen:
# publisher-side has generated col 'b'.
# subscriber-side has generated col 'b', with different computation.
$node_publisher->safe_psql('postgres',
- "CREATE TABLE tab_gen_to_gen (a int, b int GENERATED ALWAYS AS (a + 10) STORED)");
+ "CREATE TABLE tab_gen_to_gen (a int, b int GENERATED ALWAYS AS (a * 2) STORED)");
$node_subscriber->safe_psql('postgres',
- "CREATE TABLE tab_gen_to_gen (a int, b int GENERATED ALWAYS AS (a + 20) STORED)");
+ "CREATE TABLE tab_gen_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
$node_subscriber2->safe_psql('postgres',
- "CREATE TABLE tab_gen_to_gen (a int, b int GENERATED ALWAYS AS (a + 20) STORED)");
+ "CREATE TABLE tab_gen_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
+# tab_gen_to_nogen:
# publisher-side has generated col 'b'.
# subscriber-side has non-generated col 'b'.
$node_publisher->safe_psql('postgres',
"CREATE TABLE tab_gen_to_nogen (a int, b int GENERATED ALWAYS AS (a * 2) STORED)");
-$node_subscriber->safe_psql('postgres', "CREATE TABLE tab_gen_to_nogen (a int, b int)");
-$node_subscriber2->safe_psql('postgres', "CREATE TABLE tab_gen_to_nogen (a int, b int)");
+$node_subscriber->safe_psql('postgres',
+ "CREATE TABLE tab_gen_to_nogen (a int, b int)");
+$node_subscriber2->safe_psql('postgres',
+ "CREATE TABLE tab_gen_to_nogen (a int, b int)");
+# tab_gen_to_missing:
# publisher-side has generated col 'b'.
# subscriber-side col 'b' is missing.
$node_publisher->safe_psql('postgres',
- "CREATE TABLE tab_gen_to_missing (a int, b int GENERATED ALWAYS AS (a * 2) STORED)"
-);
+ "CREATE TABLE tab_gen_to_missing (a int, b int GENERATED ALWAYS AS (a * 2) STORED)");
$node_subscriber->safe_psql('postgres',
- "CREATE TABLE tab_gen_to_missing (a int)"
-);
+ "CREATE TABLE tab_gen_to_missing (a int)");
$node_subscriber2->safe_psql('postgres',
- "CREATE TABLE tab_gen_to_missing (a int)"
-);
+ "CREATE TABLE tab_gen_to_missing (a int)");
+# tab_missing_to_gen:
# publisher-side col 'b' is missing.
-# subscriber-side col 'b' is generated.
-$node_publisher->safe_psql('postgres', "CREATE TABLE tab_nogen_to_gen (a int, b int)");
+# subscriber-side has generated col 'b'.
+$node_publisher->safe_psql('postgres',
+ "CREATE TABLE tab_missing_to_gen (a int)");
$node_subscriber->safe_psql('postgres',
- "CREATE TABLE tab_nogen_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
+ "CREATE TABLE tab_missing_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
$node_subscriber2->safe_psql('postgres',
- "CREATE TABLE tab_nogen_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
+ "CREATE TABLE tab_missing_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
-# publisher-side col 'b' is missing.
-# subscriber-side col 'b' is generated.
+# tab_nogen_to_gen:
+# publisher-side has non-generated col 'b'.
+# subscriber-side has generated col 'b'.
$node_publisher->safe_psql('postgres',
- "CREATE TABLE tab_missing_to_gen (a int)"
-);
+ "CREATE TABLE tab_nogen_to_gen (a int, b int)");
$node_subscriber->safe_psql('postgres',
- "CREATE TABLE tab_missing_to_gen (a int, b int GENERATED ALWAYS AS (a * 2) STORED)"
-);
+ "CREATE TABLE tab_nogen_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
$node_subscriber2->safe_psql('postgres',
- "CREATE TABLE tab_missing_to_gen (a int, b int GENERATED ALWAYS AS (a * 2) STORED)"
-);
-
+ "CREATE TABLE tab_nogen_to_gen (a int, b int GENERATED ALWAYS AS (a * 22) STORED)");
# tab_order:
-# publisher-side has generated cols 'b' and 'c' but
-# subscriber-side has non-generated col 'b', and generated-col 'c'
-# where columns on publisher/subscriber are in a different order
+# publisher-side has generated cols 'b' and 'c'.
+# subscriber-side has non-generated col 'b', and generated-col 'c'.
+# columns on publisher/subscriber are in a different order
$node_publisher->safe_psql('postgres',
"CREATE TABLE tab_order (a int, b int GENERATED ALWAYS AS (a * 2) STORED, c int GENERATED ALWAYS AS (a * 2) STORED)"
);
@@ -107,6 +108,7 @@ $node_subscriber2->safe_psql('postgres',
$node_publisher->safe_psql('postgres',
"INSERT INTO tab1 (a) VALUES (1), (2), (3)");
+
$node_publisher->safe_psql('postgres',
"INSERT INTO tab_gen_to_gen (a) VALUES (1), (2), (3)");
$node_publisher->safe_psql('postgres',
@@ -114,52 +116,58 @@ $node_publisher->safe_psql('postgres',
$node_publisher->safe_psql('postgres',
"INSERT INTO tab_gen_to_missing (a) VALUES (1), (2), (3)");
$node_publisher->safe_psql('postgres',
- "INSERT INTO tab_nogen_to_gen (a, b) VALUES (1, 1), (2, 2), (3, 3)");
-$node_publisher->safe_psql('postgres',
"INSERT INTO tab_missing_to_gen (a) VALUES (1), (2), (3)");
$node_publisher->safe_psql('postgres',
+ "INSERT INTO tab_nogen_to_gen (a, b) VALUES (1, 1), (2, 2), (3, 3)");
+
+$node_publisher->safe_psql('postgres',
"INSERT INTO tab_order (a) VALUES (1), (2), (3)");
$node_publisher->safe_psql('postgres',
"INSERT INTO tab_alter (a) VALUES (1), (2), (3)");
+# create publications
+#
+# pub_combo_gen_to_missing is not included in pub_combo, because some tests give errors.
+
$node_publisher->safe_psql('postgres',
- "CREATE PUBLICATION regress_pub1 FOR TABLE tab1");
+ "CREATE PUBLICATION regress_pub FOR TABLE tab1");
$node_publisher->safe_psql('postgres',
- "CREATE PUBLICATION regress_pub_combo FOR TABLE tab_gen_to_gen, tab_gen_to_nogen, tab_gen_to_missing, tab_missing_to_gen");
+ "CREATE PUBLICATION regress_pub_combo FOR TABLE tab_gen_to_gen, tab_gen_to_nogen, tab_missing_to_gen");
$node_publisher->safe_psql('postgres',
- "CREATE PUBLICATION regress_pub_nogen_to_gen FOR TABLE tab_nogen_to_gen");
+ "CREATE PUBLICATION regress_pub_combo_gen_to_missing FOR TABLE tab_gen_to_missing");
+$node_publisher->safe_psql('postgres',
+ "CREATE PUBLICATION regress_pub_combo_nogen_to_gen FOR TABLE tab_nogen_to_gen");
$node_publisher->safe_psql('postgres',
"CREATE PUBLICATION regress_pub_misc FOR TABLE tab_order");
+# create subscriptions
+#
+# Note that all subscriptions created on node_subscriber2 use copy_data = false,
+# because copy_data = true with include_generated_columns is not yet supported.
+# For this reason, the expected inital data on snode_subscriber2 is always empty.
+
$node_subscriber->safe_psql('postgres',
- "CREATE SUBSCRIPTION regress_sub1 CONNECTION '$publisher_connstr' PUBLICATION regress_pub1"
+ "CREATE SUBSCRIPTION regress_sub1 CONNECTION '$publisher_connstr' PUBLICATION regress_pub"
);
-
$node_subscriber->safe_psql('postgres',
- "CREATE SUBSCRIPTION regress_sub_combo CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo"
+ "CREATE SUBSCRIPTION regress_sub1_combo CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo"
);
-
-$node_subscriber2->safe_psql('postgres',
- "CREATE SUBSCRIPTION regress_sub_combo2 CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo WITH (include_generated_columns = true, copy_data = false)"
+$node_subscriber->safe_psql('postgres',
+ "CREATE SUBSCRIPTION regress_sub1_combo_gen_to_missing CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo_gen_to_missing"
);
+
$node_subscriber2->safe_psql('postgres',
- "CREATE SUBSCRIPTION regress_sub_nogen_to_gen CONNECTION '$publisher_connstr' PUBLICATION regress_pub_nogen_to_gen WITH (include_generated_columns = true, copy_data = false)"
+ "CREATE SUBSCRIPTION regress_sub2_combo CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo WITH (include_generated_columns = true, copy_data = false)"
);
-
$node_subscriber2->safe_psql('postgres',
- "CREATE SUBSCRIPTION regress_sub_misc CONNECTION '$publisher_connstr' PUBLICATION regress_pub_misc WITH (include_generated_columns = true, copy_data = false)"
+ "CREATE SUBSCRIPTION regress_sub2_misc CONNECTION '$publisher_connstr' PUBLICATION regress_pub_misc WITH (include_generated_columns = true, copy_data = false)"
);
#####################
# Wait for initial sync of all subscriptions
#####################
-# Here, copy_data = false because COPY and include_generated_columns are not
-# allowed at the same time for patch 0001.
-# And that is why all expected results on subscriber2 will be empty.
-# This limitation will be changed in patch 0002.
-
$node_subscriber->wait_for_subscription_sync;
$node_subscriber2->wait_for_subscription_sync;
@@ -170,9 +178,9 @@ is( $result, qq(1|22
# gen-to-gen
$result = $node_subscriber->safe_psql('postgres', "SELECT a, b FROM tab_gen_to_gen");
-is( $result, qq(1|21
-2|22
-3|23), 'generated columns initial sync, when include_generated_columns=false');
+is( $result, qq(1|22
+2|44
+3|66), 'generated columns initial sync, when include_generated_columns=false');
$result = $node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_gen_to_gen");
is( $result, qq(), 'generated columns initial sync, when include_generated_columns=true');
@@ -184,18 +192,25 @@ is( $result, qq(1|
$result = $node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_gen_to_nogen");
is( $result, qq(), 'generated columns initial sync, when include_generated_columns=true');
-# nogen-to-gen
-$result = $node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_nogen_to_gen");
-is( $result, qq(), 'generated columns initial sync, when include_generated_columns=true');
+# gen-to-missing
+# Note, node_subscriber2 is not subscribing to this yet. See later.
+$result = $node_subscriber->safe_psql('postgres', "SELECT a FROM tab_gen_to_missing");
+is( $result, qq(1
+2
+3), 'generated columns initial sync, when include_generated_columns=false');
-# missing-to_gen
+# missing-to-gen
$result = $node_subscriber->safe_psql('postgres', "SELECT a, b FROM tab_missing_to_gen");
-is( $result, qq(1|2
-2|4
-3|6), 'generated columns initial sync, when include_generated_columns=false');
+is( $result, qq(1|22
+2|44
+3|66), 'generated columns initial sync, when include_generated_columns=false');
$result = $node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_missing_to_gen");
is( $result, qq(), 'generated columns initial sync, when include_generated_columns=true');
+# nogen-to-gen
+# Note, node_subscriber is not subscribing to this yet. See later
+# Note, node_subscriber2 is not subscribing to this yet. See later
+
$result = $node_subscriber2->safe_psql('postgres',
"SELECT a, b, c FROM tab_order ORDER BY a");
is( $result, qq(), 'generated column initial sync');
@@ -204,7 +219,6 @@ $result = $node_subscriber2->safe_psql('postgres',
"SELECT a, b, c FROM tab_alter ORDER BY a");
is( $result, qq(), 'unsubscribed table initial data');
-
# data to replicate
$node_publisher->safe_psql('postgres', "INSERT INTO tab1 VALUES (4), (5)");
@@ -230,30 +244,30 @@ is( $result, qq(1|22|
# insert data
$node_publisher->safe_psql('postgres', "INSERT INTO tab_gen_to_gen VALUES (4), (5)");
-# regress_sub_combo: (include_generated_columns = false)
+# regress_sub1_combo: (include_generated_columns = false)
# Confirm that col 'b' is not replicated.
#$node_publisher->wait_for_catchup('regress_pub_combo');
-$node_publisher->wait_for_catchup('regress_sub_combo');
+$node_publisher->wait_for_catchup('regress_sub1_combo');
$result =
$node_subscriber->safe_psql('postgres', "SELECT a, b FROM tab_gen_to_gen ORDER BY a");
-is( $result, qq(1|21
-2|22
-3|23
-4|24
-5|25),
- 'confirm generated columns are NOT replicated, when include_generated_columns=false'
+is( $result, qq(1|22
+2|44
+3|66
+4|88
+5|110),
+ 'confirm generated columns are not replicated when include_generated_columns=false'
);
-# regress_sub_combo2: (include_generated_columns = true)
+# regress_sub2_combo: (include_generated_columns = true)
# Confirm that col 'b' is not replicated. We can know this because the result
# value is the subscriber-side computation (which is different from the
# publisher-side computation for this column).
-$node_publisher->wait_for_catchup('regress_sub_combo2');
+$node_publisher->wait_for_catchup('regress_sub2_combo');
$result =
$node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_gen_to_gen ORDER BY a");
-is( $result, qq(4|24
-5|25),
- 'confirm generated columns are NOT replicated when the subscriber-side column is also generated'
+is( $result, qq(4|88
+5|110),
+ 'confirm generated columns are not replicated when the subscriber-side column is also generated'
);
#####################
@@ -266,9 +280,9 @@ is( $result, qq(4|24
# insert data
$node_publisher->safe_psql('postgres', "INSERT INTO tab_gen_to_nogen VALUES (4), (5)");
-# regress_sub_combo: (include_generated_columns = false)
+# regress_sub1_combo: (include_generated_columns = false)
# Confirm that col 'b' is not replicated.
-$node_publisher->wait_for_catchup('regress_sub_combo');
+$node_publisher->wait_for_catchup('regress_sub1_combo');
$result =
$node_subscriber->safe_psql('postgres', "SELECT a, b FROM tab_gen_to_nogen ORDER BY a");
is( $result, qq(1|
@@ -279,9 +293,9 @@ is( $result, qq(1|
'confirm generated columns are not replicated when the subscriber-side column is not generated'
);
-# regress_sub_combo2: (include_generated_columns = true)
+# regress_sub2_combo: (include_generated_columns = true)
# Confirm that col 'b' is replicated.
-$node_publisher->wait_for_catchup('regress_sub_combo2');
+$node_publisher->wait_for_catchup('regress_sub2_combo');
$result =
$node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_gen_to_nogen ORDER BY a");
is( $result, qq(4|8
@@ -290,28 +304,48 @@ is( $result, qq(4|8
);
#####################
-# TEST tab_nogen_to_gen
+# TEST tab_gen_to_missing
#
# publisher-side has generated col 'b'.
-# subscriber-side has non-generated col 'b'.
+# subscriber-side col 'b' is missing.
#####################
# insert data
-$node_publisher->safe_psql('postgres', "INSERT INTO tab_nogen_to_gen VALUES (4), (5)");
+$node_publisher->safe_psql('postgres', "INSERT INTO tab_gen_to_missing VALUES (4), (5)");
-# regress_sub_nogen_to_gen: (include_generated_columns = false)
+# regress_sub1_combo_gen_to_missing: (include_generated_columns = false)
# Confirm that col 'b' is not replicated.
-$node_publisher->wait_for_catchup('regress_sub_nogen_to_gen');
+$node_publisher->wait_for_catchup('regress_sub1_combo_gen_to_missing');
$result =
- $node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_nogen_to_gen ORDER BY a");
-is( $result, qq(4|88
-5|110),
- 'confirm generated columns are replicated when the subscriber-side column is not generated'
+ $node_subscriber->safe_psql('postgres', "SELECT a FROM tab_gen_to_missing ORDER BY a");
+is( $result, qq(1
+2
+3
+4
+5),
+ 'missing generated column, include_generated_columns = false'
+);
+
+# regress_sub2_combo_gen_to_missing: (include_generated_columns = true)
+# Confirm that col 'b' is not replicated and it will throw an error.
+my $offset2 = -s $node_subscriber2->logfile;
+
+# The subscription is created here, because it causes the tablesync worker to restart repetitively.
+$node_subscriber2->safe_psql('postgres',
+ "CREATE SUBSCRIPTION regress_sub2_combo_gen_to_missing CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo_gen_to_missing with (include_generated_columns = true, copy_data = false)"
);
+# insert data
+$node_publisher->safe_psql('postgres', "INSERT INTO tab_gen_to_missing VALUES (6)");
+
+$node_subscriber2->wait_for_log(
+ qr/ERROR: ( [A-Z0-9]+:)? logical replication target relation "public.tab_gen_to_missing" is missing replicated column: "b"/,
+ $offset2);
+
#Cleanup
-$node_publisher->safe_psql('postgres',"DROP PUBLICATION regress_pub_nogen_to_gen");
-$node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub_nogen_to_gen");
+$node_subscriber->safe_psql('postgres', "DROP SUBSCRIPTION regress_sub1_combo_gen_to_missing");
+$node_subscriber2->safe_psql('postgres', "DROP SUBSCRIPTION regress_sub2_combo_gen_to_missing");
+$node_publisher->safe_psql('postgres', "DROP PUBLICATION regress_pub_combo_gen_to_missing");
#####################
# TEST tab_missing_to_gen
@@ -323,33 +357,79 @@ $node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub_nogen_to_
# insert data
$node_publisher->safe_psql('postgres', "INSERT INTO tab_missing_to_gen VALUES (4), (5)");
-# regress_sub_combo: (include_generated_columns = false)
+# regress_sub1_combo: (include_generated_columns = false)
# Confirm that col 'b' is not replicated, but is generated as normal
-$node_publisher->wait_for_catchup('regress_sub_combo');
+$node_publisher->wait_for_catchup('regress_sub1_combo');
$result =
$node_subscriber->safe_psql('postgres', "SELECT a, b FROM tab_missing_to_gen ORDER BY a");
-is( $result, qq(1|2
-2|4
-3|6
-4|8
-5|10),
+is( $result, qq(1|22
+2|44
+3|66
+4|88
+5|110),
'confirm when publisher col is missing, subscriber generated columns are generated as normal'
);
-# regress_sub_combo2: (include_generated_columns = true)
+# regress_sub2_combo: (include_generated_columns = true)
# Confirm that col 'b' is not replicated, but is generated as normal
-$node_publisher->wait_for_catchup('regress_sub_combo2');
+$node_publisher->wait_for_catchup('regress_sub2_combo');
$result =
$node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_missing_to_gen ORDER BY a");
-is( $result, qq(4|8
-5|10),
+is( $result, qq(4|88
+5|110),
'confirm when publisher col is missing, subscriber generated columns are generated as normal'
);
-#Cleanup
+# cleanup
+$node_subscriber->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub1_combo");
+$node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub2_combo");
$node_publisher->safe_psql('postgres',"DROP PUBLICATION regress_pub_combo");
-$node_subscriber->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub_combo");
-$node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub_combo2");
+
+#####################
+# TEST tab_nogen_to_gen
+#
+# publisher-side has non-generated col 'b'.
+# subscriber-side has generated col 'b'.
+#####################
+
+# insert data
+$node_publisher->safe_psql('postgres', "INSERT INTO tab_nogen_to_gen VALUES (4), (5)");
+
+# regress_sub1_combo_nogen_to_gen: (include_generated_columns = false)
+# Confirm that col 'b' is not replicated and it will throw a COPY error.
+#
+# The subscription is created here, because it causes the tablesync worker to restart repetitively.
+my $offset = -s $node_subscriber->logfile;
+$node_subscriber->safe_psql('postgres',
+ "CREATE SUBSCRIPTION regress_sub1_combo_nogen_to_gen CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo_nogen_to_gen WITH (include_generated_columns = false)"
+);
+$node_subscriber->wait_for_log(
+ qr/ERROR: ( [A-Z0-9]:)? column "b" is a generated column/,
+ $offset);
+
+# regress_sub2_combo_nogen_to_gen: (include_generated_columns = true)
+#
+# XXX
+# when copy_data=false, no COPY error occurs.
+# the col 'b' is not replicated; the subscriber-side generated value is inserted.
+$node_subscriber2->safe_psql('postgres',
+ "CREATE SUBSCRIPTION regress_sub2_combo_nogen_to_gen CONNECTION '$publisher_connstr' PUBLICATION regress_pub_combo_nogen_to_gen WITH (include_generated_columns = true, copy_data = false)"
+);
+
+# insert data
+$node_publisher->safe_psql('postgres', "INSERT INTO tab_nogen_to_gen VALUES (6)");
+
+$node_publisher->wait_for_catchup('regress_sub2_combo_nogen_to_gen');
+$result =
+ $node_subscriber2->safe_psql('postgres', "SELECT a, b FROM tab_nogen_to_gen ORDER BY a");
+is( $result, qq(6|132),
+ 'confirm when publisher col is not generated, subscriber generated columns are generated as normal'
+);
+
+# cleanup
+
+$node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub2_combo_nogen_to_gen");
+$node_publisher->safe_psql('postgres',"DROP PUBLICATION regress_pub_combo_nogen_to_gen");
#####################
# TEST tab_order:
@@ -362,27 +442,27 @@ $node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub_combo2");
# insert data
$node_publisher->safe_psql('postgres', "INSERT INTO tab_order VALUES (4), (5)");
-# regress_sub_misc: (include_generated_columns = true)
-# Confirm depsite different orders replication occurs to the correct columns
-$node_publisher->wait_for_catchup('regress_sub_misc');
+# regress_sub2_misc: (include_generated_columns = true)
+# Confirm that depsite different orders replication occurs to the correct columns
+$node_publisher->wait_for_catchup('regress_sub2_misc');
$result =
$node_subscriber2->safe_psql('postgres',
"SELECT a, b, c FROM tab_order ORDER BY a");
is( $result, qq(4|8|88
-5|10|110), 'replicate generated columns with different order on subscriber');
+5|10|110), 'replicate generated columns with different order on the subscriber');
#####################
# TEST tab_alter
#
-# Add new table to existing publication, then
+# Add a new table to existing publication, then
# do ALTER SUBSCRIPTION ... REFRESH PUBLICATION
#####################
$node_publisher->safe_psql('postgres',
"ALTER PUBLICATION regress_pub_misc ADD TABLE tab_alter");
$node_subscriber2->safe_psql('postgres',
- "ALTER SUBSCRIPTION regress_sub_misc REFRESH PUBLICATION");
-$node_publisher->wait_for_catchup('regress_sub_misc');
+ "ALTER SUBSCRIPTION regress_sub2_misc REFRESH PUBLICATION");
+$node_publisher->wait_for_catchup('regress_sub2_misc');
$result = $node_subscriber2->safe_psql('postgres',
"SELECT a, b, c FROM tab_alter ORDER BY a");
is( $result, qq(1||22
@@ -404,7 +484,7 @@ $node_subscriber2->safe_psql('postgres',
$node_publisher->safe_psql('postgres',
"INSERT INTO tab_alter (a) VALUES (4), (5)");
-# confirmed replication now works for the subscriber nogen col
+# confirm that replication now works for the subscriber nogen col
$result = $node_subscriber2->safe_psql('postgres',
"SELECT a, b, c FROM tab_alter ORDER BY a");
is( $result, qq(1||22
@@ -414,8 +494,8 @@ is( $result, qq(1||22
5|10|10), 'after drop generated column expression');
#Cleanup
+$node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub2_misc");
$node_publisher->safe_psql('postgres',"DROP PUBLICATION regress_pub_misc");
-$node_subscriber2->safe_psql('postgres',"DROP SUBSCRIPTION regress_sub_misc");
#####################
# try it with a subscriber-side trigger