Simplify publication/subscription tests a bit
authorPeter Eisentraut <[email protected]>
Wed, 15 Mar 2017 20:52:12 +0000 (16:52 -0400)
committerPeter Eisentraut <[email protected]>
Wed, 15 Mar 2017 20:52:12 +0000 (16:52 -0400)
After testing RENAME TO, rename the object back.  This reduces the merge
mess when subsequent patches add test cases before or after the rename
test.

src/test/regress/expected/publication.out
src/test/regress/expected/subscription.out
src/test/regress/sql/publication.sql
src/test/regress/sql/subscription.sql

index 77482aa522f10934225432abc6190ca997c95269..7c4834b213c05363614d0ff9af116b3e6d850750 100644 (file)
@@ -180,7 +180,9 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
  testpub_foo | regress_publication_user | t       | t       | t
 (1 row)
 
-DROP PUBLICATION testpub_foo;
+-- rename back to keep the rest simple
+ALTER PUBLICATION testpub_foo RENAME TO testpub_default;
+DROP PUBLICATION testpub_default;
 DROP PUBLICATION testpib_ins_trunct;
 DROP PUBLICATION testpub_fortbl;
 DROP SCHEMA pub_test CASCADE;
index 26f0a36ff0907ebb8e786debd4ff5b216ad37584..3471d88ca76846b30d6f8d27c55470f0e8d7a8ff 100644 (file)
@@ -80,13 +80,15 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
  testsub_foo | regress_subscription_user | f       | {testpub,testpub1}
 (1 row)
 
+-- rename back to keep the rest simple
+ALTER SUBSCRIPTION testsub_foo RENAME TO testsub;
 -- fail - cannot do DROP SUBSCRIPTION DROP SLOT inside transaction block
 BEGIN;
 DROP SUBSCRIPTION testsub DROP SLOT;
 ERROR:  DROP SUBSCRIPTION ... DROP SLOT cannot run inside a transaction block
 COMMIT;
 BEGIN;
-DROP SUBSCRIPTION testsub_foo NODROP SLOT;
+DROP SUBSCRIPTION testsub NODROP SLOT;
 COMMIT;
 RESET SESSION AUTHORIZATION;
 DROP ROLE regress_subscription_user;
index 347034e92211dbb33727ae5086d9406389673dbd..46d275acc5988da313413050a373c00de9fa04e4 100644 (file)
@@ -105,7 +105,10 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
 
 \dRp testpub_foo
 
-DROP PUBLICATION testpub_foo;
+-- rename back to keep the rest simple
+ALTER PUBLICATION testpub_foo RENAME TO testpub_default;
+
+DROP PUBLICATION testpub_default;
 DROP PUBLICATION testpib_ins_trunct;
 DROP PUBLICATION testpub_fortbl;
 
index d97b4f7346f3c3cafaabf6405b0108dcc3396883..5c05b14f9e298d26d15d59d5431c2bf3c21a6f00 100644 (file)
@@ -53,13 +53,16 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
 
 \dRs
 
+-- rename back to keep the rest simple
+ALTER SUBSCRIPTION testsub_foo RENAME TO testsub;
+
 -- fail - cannot do DROP SUBSCRIPTION DROP SLOT inside transaction block
 BEGIN;
 DROP SUBSCRIPTION testsub DROP SLOT;
 COMMIT;
 
 BEGIN;
-DROP SUBSCRIPTION testsub_foo NODROP SLOT;
+DROP SUBSCRIPTION testsub NODROP SLOT;
 COMMIT;
 
 RESET SESSION AUTHORIZATION;