File tree Expand file tree Collapse file tree 5 files changed +30
-2
lines changed Expand file tree Collapse file tree 5 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -464,7 +464,7 @@ static const ObjectPropertyType ObjectProperty[] =
464464 InvalidAttrNumber ,
465465 Anum_pg_publication_pubowner ,
466466 InvalidAttrNumber ,
467- -1 ,
467+ ACL_KIND_PUBLICATION ,
468468 true
469469 },
470470 {
@@ -476,7 +476,7 @@ static const ObjectPropertyType ObjectProperty[] =
476476 InvalidAttrNumber ,
477477 Anum_pg_subscription_subowner ,
478478 InvalidAttrNumber ,
479- -1 ,
479+ ACL_KIND_SUBSCRIPTION ,
480480 true
481481 }
482482};
Original file line number Diff line number Diff line change 22-- PUBLICATION
33--
44CREATE ROLE regress_publication_user LOGIN SUPERUSER;
5+ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER;
56SET SESSION AUTHORIZATION 'regress_publication_user';
67CREATE PUBLICATION testpub_default;
78CREATE PUBLICATION testpib_ins_trunct WITH (nopublish delete, nopublish update);
@@ -148,6 +149,11 @@ DROP TABLE testpub_tbl1;
148149 t | t | t
149150(1 row)
150151
152+ -- faile - must be owner of publication
153+ SET ROLE regress_publication_user_dummy;
154+ ALTER PUBLICATION testpub_default RENAME TO testpub_dummy;
155+ ERROR: must be owner of publication testpub_default
156+ RESET ROLE;
151157ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
152158\dRp testpub_foo
153159 List of publications
@@ -163,3 +169,4 @@ DROP SCHEMA pub_test CASCADE;
163169NOTICE: drop cascades to table pub_test.testpub_nopk
164170RESET SESSION AUTHORIZATION;
165171DROP ROLE regress_publication_user;
172+ DROP ROLE regress_publication_user_dummy;
Original file line number Diff line number Diff line change 22-- SUBSCRIPTION
33--
44CREATE ROLE regress_subscription_user LOGIN SUPERUSER;
5+ CREATE ROLE regress_subscription_user_dummy LOGIN NOSUPERUSER;
56SET SESSION AUTHORIZATION 'regress_subscription_user';
67-- fail - no publications
78CREATE SUBSCRIPTION testsub CONNECTION 'foo';
@@ -66,6 +67,11 @@ ALTER SUBSCRIPTION testsub DISABLE;
6667(1 row)
6768
6869COMMIT;
70+ -- fail - must be owner of subscription
71+ SET ROLE regress_subscription_user_dummy;
72+ ALTER SUBSCRIPTION testsub RENAME TO testsub_dummy;
73+ ERROR: must be owner of subscription testsub
74+ RESET ROLE;
6975ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
7076\dRs
7177 List of subscriptions
@@ -84,3 +90,4 @@ DROP SUBSCRIPTION testsub_foo NODROP SLOT;
8490COMMIT;
8591RESET SESSION AUTHORIZATION;
8692DROP ROLE regress_subscription_user;
93+ DROP ROLE regress_subscription_user_dummy;
Original file line number Diff line number Diff line change 22-- PUBLICATION
33--
44CREATE ROLE regress_publication_user LOGIN SUPERUSER;
5+ CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER;
56SET SESSION AUTHORIZATION ' regress_publication_user' ;
67
78CREATE PUBLICATION testpub_default;
@@ -73,6 +74,11 @@ DROP TABLE testpub_tbl1;
7374
7475\dRp+ testpub_default
7576
77+ -- faile - must be owner of publication
78+ SET ROLE regress_publication_user_dummy;
79+ ALTER PUBLICATION testpub_default RENAME TO testpub_dummy;
80+ RESET ROLE;
81+
7682ALTER PUBLICATION testpub_default RENAME TO testpub_foo;
7783
7884\dRp testpub_foo
@@ -85,3 +91,4 @@ DROP SCHEMA pub_test CASCADE;
8591
8692RESET SESSION AUTHORIZATION;
8793DROP ROLE regress_publication_user;
94+ DROP ROLE regress_publication_user_dummy;
Original file line number Diff line number Diff line change 33--
44
55CREATE ROLE regress_subscription_user LOGIN SUPERUSER;
6+ CREATE ROLE regress_subscription_user_dummy LOGIN NOSUPERUSER;
67SET SESSION AUTHORIZATION ' regress_subscription_user' ;
78
89-- fail - no publications
@@ -43,6 +44,11 @@ ALTER SUBSCRIPTION testsub DISABLE;
4344
4445COMMIT ;
4546
47+ -- fail - must be owner of subscription
48+ SET ROLE regress_subscription_user_dummy;
49+ ALTER SUBSCRIPTION testsub RENAME TO testsub_dummy;
50+ RESET ROLE;
51+
4652ALTER SUBSCRIPTION testsub RENAME TO testsub_foo;
4753
4854\dRs
@@ -58,3 +64,4 @@ COMMIT;
5864
5965RESET SESSION AUTHORIZATION;
6066DROP ROLE regress_subscription_user;
67+ DROP ROLE regress_subscription_user_dummy;
You can’t perform that action at this time.
0 commit comments