diff options
-rw-r--r-- | src/backend/tcop/utility.c | 13 | ||||
-rw-r--r-- | src/test/regress/expected/object_address.out | 7 | ||||
-rw-r--r-- | src/test/regress/expected/publication.out | 189 | ||||
-rw-r--r-- | src/test/regress/expected/subscription.out | 132 | ||||
-rw-r--r-- | src/test/regress/sql/subscription.sql | 3 |
5 files changed, 172 insertions, 172 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index a25498874a..e6687ab3b2 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -2535,7 +2535,11 @@ ProcessUtilitySlow(ParseState *pstate, break; case T_CreatePublicationStmt: - address = CreatePublication((CreatePublicationStmt *) parsetree); + /* Postgres-XC does not support publications */ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XL does not support CREATE PUBLICATION"), + errdetail("The feature is not currently supported"))); break; case T_AlterPublicationStmt: @@ -2549,8 +2553,11 @@ ProcessUtilitySlow(ParseState *pstate, break; case T_CreateSubscriptionStmt: - address = CreateSubscription((CreateSubscriptionStmt *) parsetree, - isTopLevel); + /* Postgres-XC does not support subscriptions */ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("Postgres-XL does not support CREATE SUBSCRIPTION"), + errdetail("The feature is not currently supported"))); break; case T_AlterSubscriptionStmt: diff --git a/src/test/regress/expected/object_address.out b/src/test/regress/expected/object_address.out index 067c945d24..89d78ee17f 100644 --- a/src/test/regress/expected/object_address.out +++ b/src/test/regress/expected/object_address.out @@ -48,8 +48,11 @@ CREATE TRANSFORM FOR int LANGUAGE SQL ( FROM SQL WITH FUNCTION varchar_transform(internal), TO SQL WITH FUNCTION int4recv(internal)); CREATE PUBLICATION addr_pub FOR TABLE addr_nsp.gentable; +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION addr_sub CONNECTION '' PUBLICATION bar WITH (connect = false, slot_name = NONE); -WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE STATISTICS addr_nsp.gentable_stat ON a, b FROM addr_nsp.gentable; -- test some error cases SELECT pg_get_object_address('stone', '{}', '{}'); @@ -237,7 +240,9 @@ SET client_min_messages TO 'warning'; DROP FOREIGN DATA WRAPPER addr_fdw CASCADE; ERROR: foreign-data wrapper "addr_fdw" does not exist DROP PUBLICATION addr_pub; +ERROR: publication "addr_pub" does not exist DROP SUBSCRIPTION addr_sub; +ERROR: subscription "addr_sub" does not exist DROP SCHEMA addr_nsp CASCADE; DROP OWNED BY regress_addr_user; DROP USER regress_addr_user; diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out index 50592c63a9..6f34ff3e46 100644 --- a/src/test/regress/expected/publication.out +++ b/src/test/regress/expected/publication.out @@ -6,36 +6,40 @@ CREATE ROLE regress_publication_user2; CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER; SET SESSION AUTHORIZATION 'regress_publication_user'; CREATE PUBLICATION testpub_default; +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported COMMENT ON PUBLICATION testpub_default IS 'test publication'; +ERROR: publication "testpub_default" does not exist SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p; - obj_description ------------------- - test publication -(1 row) + obj_description +----------------- +(0 rows) CREATE PUBLICATION testpib_ins_trunct WITH (publish = insert); +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported ALTER PUBLICATION testpub_default SET (publish = update); +ERROR: publication "testpub_default" does not exist -- error cases CREATE PUBLICATION testpub_xxx WITH (foo); -ERROR: unrecognized publication parameter: foo +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported CREATE PUBLICATION testpub_xxx WITH (publish = 'cluster, vacuum'); -ERROR: unrecognized "publish" value: "cluster" +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported \dRp - List of publications - Name | Owner | All tables | Inserts | Updates | Deletes ---------------------+--------------------------+------------+---------+---------+--------- - testpib_ins_trunct | regress_publication_user | f | t | f | f - testpub_default | regress_publication_user | f | f | t | f -(2 rows) + List of publications + Name | Owner | All tables | Inserts | Updates | Deletes +------+-------+------------+---------+---------+--------- +(0 rows) ALTER PUBLICATION testpub_default SET (publish = 'insert, update, delete'); +ERROR: publication "testpub_default" does not exist \dRp - List of publications - Name | Owner | All tables | Inserts | Updates | Deletes ---------------------+--------------------------+------------+---------+---------+--------- - testpib_ins_trunct | regress_publication_user | f | t | f | f - testpub_default | regress_publication_user | f | t | t | t -(2 rows) + List of publications + Name | Owner | All tables | Inserts | Updates | Deletes +------+-------+------------+---------+---------+--------- +(0 rows) --- adding tables CREATE SCHEMA pub_test; @@ -44,25 +48,24 @@ CREATE TABLE pub_test.testpub_nopk (foo int, bar int); CREATE VIEW testpub_view AS SELECT 1; CREATE TABLE testpub_parted (a int) PARTITION BY LIST (a); CREATE PUBLICATION testpub_foralltables FOR ALL TABLES WITH (publish = 'insert'); +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported ALTER PUBLICATION testpub_foralltables SET (publish = 'insert, update'); +ERROR: publication "testpub_foralltables" does not exist CREATE TABLE testpub_tbl2 (id serial primary key, data text); -- fail - can't add to for all tables publication ALTER PUBLICATION testpub_foralltables ADD TABLE testpub_tbl2; -ERROR: publication "testpub_foralltables" is defined as FOR ALL TABLES -DETAIL: Tables cannot be added to or dropped from FOR ALL TABLES publications. +ERROR: publication "testpub_foralltables" does not exist -- fail - can't drop from all tables publication ALTER PUBLICATION testpub_foralltables DROP TABLE testpub_tbl2; -ERROR: publication "testpub_foralltables" is defined as FOR ALL TABLES -DETAIL: Tables cannot be added to or dropped from FOR ALL TABLES publications. +ERROR: publication "testpub_foralltables" does not exist -- fail - can't add to for all tables publication ALTER PUBLICATION testpub_foralltables SET TABLE pub_test.testpub_nopk; -ERROR: publication "testpub_foralltables" is defined as FOR ALL TABLES -DETAIL: Tables cannot be added to or dropped from FOR ALL TABLES publications. +ERROR: publication "testpub_foralltables" does not exist SELECT pubname, puballtables FROM pg_publication WHERE pubname = 'testpub_foralltables'; - pubname | puballtables -----------------------+-------------- - testpub_foralltables | t -(1 row) + pubname | puballtables +---------+-------------- +(0 rows) \d+ testpub_tbl2 Table "public.testpub_tbl2" @@ -72,84 +75,63 @@ SELECT pubname, puballtables FROM pg_publication WHERE pubname = 'testpub_forall data | text | | | | extended | | Indexes: "testpub_tbl2_pkey" PRIMARY KEY, btree (id) -Publications: - "testpub_foralltables" +Distribute By: HASH(id) +Location Nodes: ALL DATANODES \dRp+ testpub_foralltables - Publication testpub_foralltables - All tables | Inserts | Updates | Deletes -------------+---------+---------+--------- - t | t | t | f -(1 row) - DROP TABLE testpub_tbl2; DROP PUBLICATION testpub_foralltables; +ERROR: publication "testpub_foralltables" does not exist CREATE TABLE testpub_tbl3 (a int); CREATE TABLE testpub_tbl3a (b text) INHERITS (testpub_tbl3); CREATE PUBLICATION testpub3 FOR TABLE testpub_tbl3; +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported CREATE PUBLICATION testpub4 FOR TABLE ONLY testpub_tbl3; +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported \dRp+ testpub3 - Publication testpub3 - All tables | Inserts | Updates | Deletes -------------+---------+---------+--------- - f | t | t | t -Tables: - "public.testpub_tbl3" - "public.testpub_tbl3a" - \dRp+ testpub4 - Publication testpub4 - All tables | Inserts | Updates | Deletes -------------+---------+---------+--------- - f | t | t | t -Tables: - "public.testpub_tbl3" - DROP TABLE testpub_tbl3, testpub_tbl3a; DROP PUBLICATION testpub3, testpub4; +ERROR: publication "testpub3" does not exist -- fail - view CREATE PUBLICATION testpub_fortbl FOR TABLE testpub_view; -ERROR: "testpub_view" is not a table -DETAIL: Only tables can be added to publications. +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported CREATE PUBLICATION testpub_fortbl FOR TABLE testpub_tbl1, pub_test.testpub_nopk; +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported -- fail - already added ALTER PUBLICATION testpub_fortbl ADD TABLE testpub_tbl1; -ERROR: relation "testpub_tbl1" is already member of publication "testpub_fortbl" +ERROR: publication "testpub_fortbl" does not exist -- fail - already added CREATE PUBLICATION testpub_fortbl FOR TABLE testpub_tbl1; -ERROR: publication "testpub_fortbl" already exists +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported \dRp+ testpub_fortbl - Publication testpub_fortbl - All tables | Inserts | Updates | Deletes -------------+---------+---------+--------- - f | t | t | t -Tables: - "pub_test.testpub_nopk" - "public.testpub_tbl1" - -- fail - view ALTER PUBLICATION testpub_default ADD TABLE testpub_view; -ERROR: "testpub_view" is not a table -DETAIL: Only tables can be added to publications. +ERROR: publication "testpub_default" does not exist -- fail - partitioned table ALTER PUBLICATION testpub_fortbl ADD TABLE testpub_parted; -ERROR: "testpub_parted" is a partitioned table -DETAIL: Adding partitioned tables to publications is not supported. -HINT: You can add the table partitions individually. +ERROR: publication "testpub_fortbl" does not exist ALTER PUBLICATION testpub_default ADD TABLE testpub_tbl1; +ERROR: publication "testpub_default" does not exist ALTER PUBLICATION testpub_default SET TABLE testpub_tbl1; +ERROR: publication "testpub_default" does not exist ALTER PUBLICATION testpub_default ADD TABLE pub_test.testpub_nopk; +ERROR: publication "testpub_default" does not exist ALTER PUBLICATION testpib_ins_trunct ADD TABLE pub_test.testpub_nopk, testpub_tbl1; +ERROR: publication "testpib_ins_trunct" does not exist \d+ pub_test.testpub_nopk Table "pub_test.testpub_nopk" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description --------+---------+-----------+----------+---------+---------+--------------+------------- foo | integer | | | | plain | | bar | integer | | | | plain | | -Publications: - "testpib_ins_trunct" - "testpub_default" - "testpub_fortbl" +Distribute By: HASH(foo) +Location Nodes: ALL DATANODES \d+ testpub_tbl1 Table "public.testpub_tbl1" @@ -159,24 +141,15 @@ Publications: data | text | | | | extended | | Indexes: "testpub_tbl1_pkey" PRIMARY KEY, btree (id) -Publications: - "testpib_ins_trunct" - "testpub_default" - "testpub_fortbl" +Distribute By: HASH(id) +Location Nodes: ALL DATANODES \dRp+ testpub_default - Publication testpub_default - All tables | Inserts | Updates | Deletes -------------+---------+---------+--------- - f | t | t | t -Tables: - "pub_test.testpub_nopk" - "public.testpub_tbl1" - ALTER PUBLICATION testpub_default DROP TABLE testpub_tbl1, pub_test.testpub_nopk; +ERROR: publication "testpub_default" does not exist -- fail - nonexistent ALTER PUBLICATION testpub_default DROP TABLE pub_test.testpub_nopk; -ERROR: relation "testpub_nopk" is not part of the publication +ERROR: publication "testpub_default" does not exist \d+ testpub_tbl1 Table "public.testpub_tbl1" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description @@ -185,63 +158,65 @@ ERROR: relation "testpub_nopk" is not part of the publication data | text | | | | extended | | Indexes: "testpub_tbl1_pkey" PRIMARY KEY, btree (id) -Publications: - "testpib_ins_trunct" - "testpub_fortbl" +Distribute By: HASH(id) +Location Nodes: ALL DATANODES -- permissions SET ROLE regress_publication_user2; CREATE PUBLICATION testpub2; -- fail -ERROR: permission denied for database regression +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported SET ROLE regress_publication_user; GRANT CREATE ON DATABASE regression TO regress_publication_user2; SET ROLE regress_publication_user2; CREATE PUBLICATION testpub2; -- ok +ERROR: Postgres-XL does not support CREATE PUBLICATION +DETAIL: The feature is not currently supported ALTER PUBLICATION testpub2 ADD TABLE testpub_tbl1; -- fail -ERROR: must be owner of relation testpub_tbl1 +ERROR: publication "testpub2" does not exist SET ROLE regress_publication_user; GRANT regress_publication_user TO regress_publication_user2; SET ROLE regress_publication_user2; ALTER PUBLICATION testpub2 ADD TABLE testpub_tbl1; -- ok +ERROR: publication "testpub2" does not exist DROP PUBLICATION testpub2; +ERROR: publication "testpub2" does not exist SET ROLE regress_publication_user; REVOKE CREATE ON DATABASE regression FROM regress_publication_user2; DROP TABLE testpub_parted; DROP VIEW testpub_view; DROP TABLE testpub_tbl1; \dRp+ testpub_default - Publication testpub_default - All tables | Inserts | Updates | Deletes -------------+---------+---------+--------- - f | t | t | t -(1 row) - -- fail - must be owner of publication SET ROLE regress_publication_user_dummy; ALTER PUBLICATION testpub_default RENAME TO testpub_dummy; -ERROR: must be owner of publication testpub_default +ERROR: publication "testpub_default" does not exist RESET ROLE; ALTER PUBLICATION testpub_default RENAME TO testpub_foo; +ERROR: publication "testpub_default" does not exist \dRp testpub_foo - List of publications - Name | Owner | All tables | Inserts | Updates | Deletes --------------+--------------------------+------------+---------+---------+--------- - testpub_foo | regress_publication_user | f | t | t | t -(1 row) + List of publications + Name | Owner | All tables | Inserts | Updates | Deletes +------+-------+------------+---------+---------+--------- +(0 rows) -- rename back to keep the rest simple ALTER PUBLICATION testpub_foo RENAME TO testpub_default; +ERROR: publication "testpub_foo" does not exist ALTER PUBLICATION testpub_default OWNER TO regress_publication_user2; +ERROR: publication "testpub_default" does not exist \dRp testpub_default - List of publications - Name | Owner | All tables | Inserts | Updates | Deletes ------------------+---------------------------+------------+---------+---------+--------- - testpub_default | regress_publication_user2 | f | t | t | t -(1 row) + List of publications + Name | Owner | All tables | Inserts | Updates | Deletes +------+-------+------------+---------+---------+--------- +(0 rows) DROP PUBLICATION testpub_default; +ERROR: publication "testpub_default" does not exist DROP PUBLICATION testpib_ins_trunct; +ERROR: publication "testpib_ins_trunct" does not exist DROP PUBLICATION testpub_fortbl; +ERROR: publication "testpub_fortbl" does not exist DROP SCHEMA pub_test CASCADE; NOTICE: drop cascades to table pub_test.testpub_nopk RESET SESSION AUTHORIZATION; diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out index 4fcbf7efe9..113dba7fb8 100644 --- a/src/test/regress/expected/subscription.out +++ b/src/test/regress/expected/subscription.out @@ -18,138 +18,154 @@ LINE 1: CREATE SUBSCRIPTION testsub PUBLICATION foo; -- fail - cannot do CREATE SUBSCRIPTION CREATE SLOT inside transaction block BEGIN; CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub WITH (create_slot); -ERROR: CREATE SUBSCRIPTION ... WITH (create_slot = true) cannot run inside a transaction block +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported COMMIT; -- fail - invalid connection string CREATE SUBSCRIPTION testsub CONNECTION 'testconn' PUBLICATION testpub; -ERROR: invalid connection string syntax: missing "=" after "testconn" in connection info string - +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported -- fail - duplicate publications CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION foo, testpub, foo WITH (connect = false); -ERROR: publication name "foo" used more than once +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported -- ok CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (connect = false); -WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported COMMENT ON SUBSCRIPTION testsub IS 'test subscription'; +ERROR: subscription "testsub" does not exist SELECT obj_description(s.oid, 'pg_subscription') FROM pg_subscription s; - obj_description -------------------- - test subscription -(1 row) + obj_description +----------------- +(0 rows) -- fail - name already exists CREATE SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (connect = false); -ERROR: subscription "testsub" already exists +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported -- fail - must be superuser SET SESSION AUTHORIZATION 'regress_subscription_user2'; CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION foo WITH (connect = false); -ERROR: must be superuser to create subscriptions +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported SET SESSION AUTHORIZATION 'regress_subscription_user'; -- fail - invalid option combinations CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (connect = false, copy_data = true); -ERROR: connect = false and copy_data = true are mutually exclusive options +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (connect = false, enabled = true); -ERROR: connect = false and enabled = true are mutually exclusive options +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (connect = false, create_slot = true); -ERROR: connect = false and create_slot = true are mutually exclusive options +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, enabled = true); -ERROR: slot_name = NONE and enabled = true are mutually exclusive options +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, create_slot = true); -ERROR: slot_name = NONE and create_slot = true are mutually exclusive options +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE); -ERROR: subscription with slot_name = NONE must also set enabled = false +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, enabled = false); -ERROR: subscription with slot_name = NONE must also set create_slot = false +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, create_slot = false); -ERROR: subscription with slot_name = NONE must also set enabled = false +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported -- ok - with slot_name = NONE CREATE SUBSCRIPTION testsub3 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, connect = false); -WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables +ERROR: Postgres-XL does not support CREATE SUBSCRIPTION +DETAIL: The feature is not currently supported -- fail ALTER SUBSCRIPTION testsub3 ENABLE; -ERROR: cannot enable subscription that does not have a slot name +ERROR: subscription "testsub3" does not exist ALTER SUBSCRIPTION testsub3 REFRESH PUBLICATION; -ERROR: ALTER SUBSCRIPTION ... REFRESH is not allowed for disabled subscriptions +ERROR: subscription "testsub3" does not exist DROP SUBSCRIPTION testsub3; +ERROR: subscription "testsub3" does not exist -- fail - invalid connection string ALTER SUBSCRIPTION testsub CONNECTION 'foobar'; -ERROR: invalid connection string syntax: missing "=" after "foobar" in connection info string - +ERROR: subscription "testsub" does not exist \dRs+ - List of subscriptions - Name | Owner | Enabled | Publication | Synchronous commit | Conninfo ----------+---------------------------+---------+-------------+--------------------+--------------------- - testsub | regress_subscription_user | f | {testpub} | off | dbname=doesnotexist -(1 row) + List of subscriptions + Name | Owner | Enabled | Publication | Synchronous commit | Conninfo +------+-------+---------+-------------+--------------------+---------- +(0 rows) ALTER SUBSCRIPTION testsub SET PUBLICATION testpub2, testpub3 WITH (refresh = false); +ERROR: subscription "testsub" does not exist ALTER SUBSCRIPTION testsub CONNECTION 'dbname=doesnotexist2'; +ERROR: subscription "testsub" does not exist ALTER SUBSCRIPTION testsub SET (slot_name = 'newname'); +ERROR: subscription "testsub" does not exist -- fail ALTER SUBSCRIPTION doesnotexist CONNECTION 'dbname=doesnotexist2'; ERROR: subscription "doesnotexist" does not exist ALTER SUBSCRIPTION testsub SET (create_slot = false); -ERROR: unrecognized subscription parameter: create_slot +ERROR: subscription "testsub" does not exist \dRs+ - List of subscriptions - Name | Owner | Enabled | Publication | Synchronous commit | Conninfo ----------+---------------------------+---------+---------------------+--------------------+---------------------- - testsub | regress_subscription_user | f | {testpub2,testpub3} | off | dbname=doesnotexist2 -(1 row) + List of subscriptions + Name | Owner | Enabled | Publication | Synchronous commit | Conninfo +------+-------+---------+-------------+--------------------+---------- +(0 rows) -BEGIN; ALTER SUBSCRIPTION testsub ENABLE; +ERROR: subscription "testsub" does not exist \dRs - List of subscriptions - Name | Owner | Enabled | Publication ----------+---------------------------+---------+--------------------- - testsub | regress_subscription_user | t | {testpub2,testpub3} -(1 row) + List of subscriptions + Name | Owner | Enabled | Publication +------+-------+---------+------------- +(0 rows) ALTER SUBSCRIPTION testsub DISABLE; +ERROR: subscription "testsub" does not exist \dRs - List of subscriptions - Name | Owner | Enabled | Publication ----------+---------------------------+---------+--------------------- - testsub | regress_subscription_user | f | {testpub2,testpub3} -(1 row) + List of subscriptions + Name | Owner | Enabled | Publication +------+-------+---------+------------- +(0 rows) -COMMIT; -- fail - must be owner of subscription SET ROLE regress_subscription_user_dummy; ALTER SUBSCRIPTION testsub RENAME TO testsub_dummy; -ERROR: must be owner of subscription testsub +ERROR: subscription "testsub" does not exist RESET ROLE; ALTER SUBSCRIPTION testsub RENAME TO testsub_foo; +ERROR: subscription "testsub" does not exist ALTER SUBSCRIPTION testsub_foo SET (synchronous_commit = local); +ERROR: subscription "testsub_foo" does not exist ALTER SUBSCRIPTION testsub_foo SET (synchronous_commit = foobar); -ERROR: invalid value for parameter "synchronous_commit": "foobar" -HINT: Available values: local, remote_write, remote_apply, on, off. +ERROR: subscription "testsub_foo" does not exist \dRs+ - List of subscriptions - Name | Owner | Enabled | Publication | Synchronous commit | Conninfo --------------+---------------------------+---------+---------------------+--------------------+---------------------- - testsub_foo | regress_subscription_user | f | {testpub2,testpub3} | local | dbname=doesnotexist2 -(1 row) + List of subscriptions + Name | Owner | Enabled | Publication | Synchronous commit | Conninfo +------+-------+---------+-------------+--------------------+---------- +(0 rows) -- rename back to keep the rest simple ALTER SUBSCRIPTION testsub_foo RENAME TO testsub; +ERROR: subscription "testsub_foo" does not exist -- fail - new owner must be superuser ALTER SUBSCRIPTION testsub OWNER TO regress_subscription_user2; -ERROR: permission denied to change owner of subscription "testsub" -HINT: The owner of a subscription must be a superuser. +ERROR: subscription "testsub" does not exist ALTER ROLE regress_subscription_user2 SUPERUSER; -- now it works ALTER SUBSCRIPTION testsub OWNER TO regress_subscription_user2; +ERROR: subscription "testsub" does not exist -- fail - cannot do DROP SUBSCRIPTION inside transaction block with slot name BEGIN; DROP SUBSCRIPTION testsub; -ERROR: DROP SUBSCRIPTION cannot run inside a transaction block +ERROR: subscription "testsub" does not exist COMMIT; ALTER SUBSCRIPTION testsub SET (slot_name = NONE); +ERROR: subscription "testsub" does not exist -- now it works BEGIN; DROP SUBSCRIPTION testsub; +ERROR: subscription "testsub" does not exist COMMIT; DROP SUBSCRIPTION IF EXISTS testsub; NOTICE: subscription "testsub" does not exist, skipping diff --git a/src/test/regress/sql/subscription.sql b/src/test/regress/sql/subscription.sql index 36fa1bbac8..c049589ae7 100644 --- a/src/test/regress/sql/subscription.sql +++ b/src/test/regress/sql/subscription.sql @@ -71,7 +71,6 @@ ALTER SUBSCRIPTION testsub SET (create_slot = false); \dRs+ -BEGIN; ALTER SUBSCRIPTION testsub ENABLE; \dRs @@ -80,8 +79,6 @@ ALTER SUBSCRIPTION testsub DISABLE; \dRs -COMMIT; - -- fail - must be owner of subscription SET ROLE regress_subscription_user_dummy; ALTER SUBSCRIPTION testsub RENAME TO testsub_dummy; |