@@ -33,22 +33,16 @@ ERROR: role "pg_database_owner" cannot have explicit members
33
33
CREATE ROLE regress_inroles ROLE
34
34
regress_role_super, regress_createdb, regress_createrole, regress_login,
35
35
regress_inherit, regress_connection_limit, regress_encrypted_password, regress_password_null;
36
- ERROR: permission denied to grant role "regress_inroles"
37
- DETAIL: Only roles with the ADMIN option on role "regress_inroles" may grant this role.
38
36
-- fail, cannot grant a role into itself
39
37
CREATE ROLE regress_nosuch_recursive ROLE regress_nosuch_recursive;
40
- ERROR: permission denied to grant role "regress_nosuch_recursive"
41
- DETAIL: Only roles with the ADMIN option on role "regress_nosuch_recursive" may grant this role.
38
+ ERROR: role "regress_nosuch_recursive" is a member of role "regress_nosuch_recursive"
42
39
-- ok, can grant other users into a role with admin option
43
40
CREATE ROLE regress_adminroles ADMIN
44
41
regress_role_super, regress_createdb, regress_createrole, regress_login,
45
42
regress_inherit, regress_connection_limit, regress_encrypted_password, regress_password_null;
46
- ERROR: permission denied to grant role "regress_adminroles"
47
- DETAIL: Only roles with the ADMIN option on role "regress_adminroles" may grant this role.
48
43
-- fail, cannot grant a role into itself with admin option
49
44
CREATE ROLE regress_nosuch_admin_recursive ADMIN regress_nosuch_admin_recursive;
50
- ERROR: permission denied to grant role "regress_nosuch_admin_recursive"
51
- DETAIL: Only roles with the ADMIN option on role "regress_nosuch_admin_recursive" may grant this role.
45
+ ERROR: role "regress_nosuch_admin_recursive" is a member of role "regress_nosuch_admin_recursive"
52
46
-- fail, regress_createrole does not have CREATEDB privilege
53
47
SET SESSION AUTHORIZATION regress_createrole;
54
48
CREATE DATABASE regress_nosuch_db;
@@ -68,18 +62,13 @@ REVOKE ALL PRIVILEGES ON tenant_table FROM PUBLIC;
68
62
-- fail, these objects belonging to regress_tenant
69
63
SET SESSION AUTHORIZATION regress_createrole;
70
64
DROP INDEX tenant_idx;
71
- ERROR: must be owner of index tenant_idx
72
65
ALTER TABLE tenant_table ADD COLUMN t text;
73
- ERROR: must be owner of table tenant_table
74
66
DROP TABLE tenant_table;
75
- ERROR: must be owner of table tenant_table
76
67
ALTER VIEW tenant_view OWNER TO regress_role_admin;
77
- ERROR: must be owner of view tenant_view
68
+ ERROR: must be member of role "regress_role_admin"
78
69
DROP VIEW tenant_view;
79
- ERROR: must be owner of view tenant_view
80
70
-- fail, cannot take ownership of these objects from regress_tenant
81
71
REASSIGN OWNED BY regress_tenant TO regress_createrole;
82
- ERROR: permission denied to reassign objects
83
72
-- ok, having CREATEROLE is enough to create roles in privileged roles
84
73
CREATE ROLE regress_read_all_data IN ROLE pg_read_all_data;
85
74
ERROR: permission denied to grant role "pg_read_all_data"
@@ -140,9 +129,7 @@ DROP ROLE regress_encrypted_password;
140
129
DROP ROLE regress_password_null;
141
130
DROP ROLE regress_noiseword;
142
131
DROP ROLE regress_inroles;
143
- ERROR: role "regress_inroles" does not exist
144
132
DROP ROLE regress_adminroles;
145
- ERROR: role "regress_adminroles" does not exist
146
133
DROP ROLE regress_rolecreator;
147
134
DROP ROLE regress_read_all_data;
148
135
ERROR: role "regress_read_all_data" does not exist
@@ -166,9 +153,6 @@ DROP ROLE regress_signal_backend;
166
153
ERROR: role "regress_signal_backend" does not exist
167
154
-- fail, role still owns database objects
168
155
DROP ROLE regress_tenant;
169
- ERROR: role "regress_tenant" cannot be dropped because some objects depend on it
170
- DETAIL: owner of table tenant_table
171
- owner of view tenant_view
172
156
-- fail, cannot drop ourself nor superusers
173
157
DROP ROLE regress_role_super;
174
158
ERROR: must be superuser to drop superusers
@@ -177,8 +161,12 @@ ERROR: current user cannot be dropped
177
161
-- ok
178
162
RESET SESSION AUTHORIZATION;
179
163
DROP INDEX tenant_idx;
164
+ ERROR: index "tenant_idx" does not exist
180
165
DROP TABLE tenant_table;
166
+ ERROR: table "tenant_table" does not exist
181
167
DROP VIEW tenant_view;
168
+ ERROR: view "tenant_view" does not exist
182
169
DROP ROLE regress_tenant;
170
+ ERROR: role "regress_tenant" does not exist
183
171
DROP ROLE regress_role_admin;
184
172
DROP ROLE regress_role_super;
0 commit comments