From: Japin Li <japinli@hotmail.com>
Subject: [PATCH v2 2/4] Test ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION
Date: Tue, 26 Jan 2021 17:43:11 +0800
---
src/test/regress/expected/subscription.out | 27 ++++++++++++++++++++++
src/test/regress/sql/subscription.sql | 19 +++++++++++++++
2 files changed, 46 insertions(+)
diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.outindex 2fa9bce66a..f0412220bc 100644--- a/src/test/regress/expected/subscription.out+++ b/src/test/regress/expected/subscription.out@@ -200,6 +200,33 @@ ALTER SUBSCRIPTION regress_testsub SET (slot_name = NONE);
regress_testsub | regress_subscription_user | f | {testpub} | f | f | off | dbname=regress_doesnotexist
(1 row)
+-- fail - publication already exists+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub WITH (refresh = false);+ERROR: publication name "testpub" is already in subscription+-- ok - add two publications into subscription+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub1, testpub2 WITH (refresh = false);+\dRs++ List of subscriptions+ Name | Owner | Enabled | Publication | Binary | Streaming | Synchronous commit | Conninfo +-----------------+---------------------------+---------+-----------------------------+--------+-----------+--------------------+-----------------------------+ regress_testsub | regress_subscription_user | f | {testpub,testpub1,testpub2} | f | f | off | dbname=regress_doesnotexist+(1 row)++-- fail - all publications are deleted+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub, testpub1, testpub2 WITH (refresh = false);+ERROR: subscription must contain at least one publication+-- fail - the deleted publications do not in subscription+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub3 WITH (refresh = false);+ERROR: publication name "testpub3" do not in subscription+-- ok - delete publications+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub1, testpub2 WITH (refresh = false);+\dRs++ List of subscriptions+ Name | Owner | Enabled | Publication | Binary | Streaming | Synchronous commit | Conninfo +-----------------+---------------------------+---------+-------------+--------+-----------+--------------------+-----------------------------+ regress_testsub | regress_subscription_user | f | {testpub} | f | f | off | dbname=regress_doesnotexist+(1 row)+
DROP SUBSCRIPTION regress_testsub;
RESET SESSION AUTHORIZATION;
DROP ROLE regress_subscription_user;
diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sqlindex 14fa0b247e..ffb93f084d 100644--- a/src/test/regress/sql/subscription.sql+++ b/src/test/regress/sql/subscription.sql@@ -145,6 +145,25 @@ ALTER SUBSCRIPTION regress_testsub SET (slot_name = NONE);
\dRs+
+-- fail - publication already exists+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub WITH (refresh = false);++-- ok - add two publications into subscription+ALTER SUBSCRIPTION regress_testsub ADD PUBLICATION testpub1, testpub2 WITH (refresh = false);++\dRs+++-- fail - all publications are deleted+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub, testpub1, testpub2 WITH (refresh = false);++-- fail - the deleted publications do not in subscription+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub3 WITH (refresh = false);++-- ok - delete publications+ALTER SUBSCRIPTION regress_testsub DROP PUBLICATION testpub1, testpub2 WITH (refresh = false);++\dRs++
DROP SUBSCRIPTION regress_testsub;
RESET SESSION AUTHORIZATION;
--
2.30.0
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
filename=v2-0003-Add-documentation-for-ALTER-SUBSCRIPTION.ADD-DROP.patch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: japinli@hotmail.com
Subject: Re: [PATCH v2 2/4] Test ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION
In-Reply-To: <no-message-id-684303@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox