Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd1827c

Browse files
committed
Simplify publication/subscription tests a bit
After testing RENAME TO, rename the object back. This reduces the mergemess when subsequent patches add test cases before or after the renametest.
1 parentf2a9998 commitbd1827c

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

‎src/test/regress/expected/publication.out

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
180180
testpub_foo | regress_publication_user | t | t | t
181181
(1 row)
182182

183-
DROP PUBLICATION testpub_foo;
183+
-- rename back to keep the rest simple
184+
ALTER PUBLICATION testpub_foo RENAME TO testpub_default;
185+
DROP PUBLICATION testpub_default;
184186
DROP PUBLICATION testpib_ins_trunct;
185187
DROP PUBLICATION testpub_fortbl;
186188
DROP SCHEMA pub_test CASCADE;

‎src/test/regress/expected/subscription.out

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,15 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
8080
testsub_foo | regress_subscription_user | f | {testpub,testpub1}
8181
(1 row)
8282

83+
-- rename back to keep the rest simple
84+
ALTER SUBSCRIPTION testsub_foo RENAME TO testsub;
8385
-- fail - cannot do DROP SUBSCRIPTION DROP SLOT inside transaction block
8486
BEGIN;
8587
DROP SUBSCRIPTION testsub DROP SLOT;
8688
ERROR: DROP SUBSCRIPTION ... DROP SLOT cannot run inside a transaction block
8789
COMMIT;
8890
BEGIN;
89-
DROP SUBSCRIPTIONtestsub_foo NODROP SLOT;
91+
DROP SUBSCRIPTIONtestsub NODROP SLOT;
9092
COMMIT;
9193
RESET SESSION AUTHORIZATION;
9294
DROP ROLE regress_subscription_user;

‎src/test/regress/sql/publication.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
105105

106106
\dRp testpub_foo
107107

108-
DROP PUBLICATION testpub_foo;
108+
-- rename back to keep the rest simple
109+
ALTER PUBLICATION testpub_foo RENAME TO testpub_default;
110+
111+
DROP PUBLICATION testpub_default;
109112
DROP PUBLICATION testpib_ins_trunct;
110113
DROP PUBLICATION testpub_fortbl;
111114

‎src/test/regress/sql/subscription.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
5353

5454
\dRs
5555

56+
-- rename back to keep the rest simple
57+
ALTER SUBSCRIPTION testsub_foo RENAME TO testsub;
58+
5659
-- fail - cannot do DROP SUBSCRIPTION DROP SLOT inside transaction block
5760
BEGIN;
5861
DROP SUBSCRIPTION testsub DROP SLOT;
5962
COMMIT;
6063

6164
BEGIN;
62-
DROP SUBSCRIPTIONtestsub_foo NODROP SLOT;
65+
DROP SUBSCRIPTIONtestsub NODROP SLOT;
6366
COMMIT;
6467

6568
RESET SESSION AUTHORIZATION;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp