Commit bd1827c7 authored by Peter Eisentraut's avatar Peter Eisentraut

Simplify publication/subscription tests a bit

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.
parent f2a9998f
...@@ -180,7 +180,9 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo; ...@@ -180,7 +180,9 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
testpub_foo | regress_publication_user | t | t | t testpub_foo | regress_publication_user | t | t | t
(1 row) (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 testpib_ins_trunct;
DROP PUBLICATION testpub_fortbl; DROP PUBLICATION testpub_fortbl;
DROP SCHEMA pub_test CASCADE; DROP SCHEMA pub_test CASCADE;
......
...@@ -80,13 +80,15 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo; ...@@ -80,13 +80,15 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
testsub_foo | regress_subscription_user | f | {testpub,testpub1} testsub_foo | regress_subscription_user | f | {testpub,testpub1}
(1 row) (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 -- fail - cannot do DROP SUBSCRIPTION DROP SLOT inside transaction block
BEGIN; BEGIN;
DROP SUBSCRIPTION testsub DROP SLOT; DROP SUBSCRIPTION testsub DROP SLOT;
ERROR: DROP SUBSCRIPTION ... DROP SLOT cannot run inside a transaction block ERROR: DROP SUBSCRIPTION ... DROP SLOT cannot run inside a transaction block
COMMIT; COMMIT;
BEGIN; BEGIN;
DROP SUBSCRIPTION testsub_foo NODROP SLOT; DROP SUBSCRIPTION testsub NODROP SLOT;
COMMIT; COMMIT;
RESET SESSION AUTHORIZATION; RESET SESSION AUTHORIZATION;
DROP ROLE regress_subscription_user; DROP ROLE regress_subscription_user;
......
...@@ -105,7 +105,10 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo; ...@@ -105,7 +105,10 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
\dRp 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 testpib_ins_trunct;
DROP PUBLICATION testpub_fortbl; DROP PUBLICATION testpub_fortbl;
......
...@@ -53,13 +53,16 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo; ...@@ -53,13 +53,16 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
\dRs \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 -- fail - cannot do DROP SUBSCRIPTION DROP SLOT inside transaction block
BEGIN; BEGIN;
DROP SUBSCRIPTION testsub DROP SLOT; DROP SUBSCRIPTION testsub DROP SLOT;
COMMIT; COMMIT;
BEGIN; BEGIN;
DROP SUBSCRIPTION testsub_foo NODROP SLOT; DROP SUBSCRIPTION testsub NODROP SLOT;
COMMIT; COMMIT;
RESET SESSION AUTHORIZATION; RESET SESSION AUTHORIZATION;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment