Skip to content

Commit 4f75145

Browse files
knizhnikKonstantin Knizhnik
authored andcommitted
Update expected file for create_role test (#301)
* Make it possible to grant self created roles * Update expected file for create_role test --------- Co-authored-by: Konstantin Knizhnik <[email protected]>
1 parent e05510c commit 4f75145

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

src/test/regress/expected/create_role.out

+7-19
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,16 @@ ERROR: role "pg_database_owner" cannot have explicit members
3333
CREATE ROLE regress_inroles ROLE
3434
regress_role_super, regress_createdb, regress_createrole, regress_login,
3535
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.
3836
-- fail, cannot grant a role into itself
3937
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"
4239
-- ok, can grant other users into a role with admin option
4340
CREATE ROLE regress_adminroles ADMIN
4441
regress_role_super, regress_createdb, regress_createrole, regress_login,
4542
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.
4843
-- fail, cannot grant a role into itself with admin option
4944
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"
5246
-- fail, regress_createrole does not have CREATEDB privilege
5347
SET SESSION AUTHORIZATION regress_createrole;
5448
CREATE DATABASE regress_nosuch_db;
@@ -68,18 +62,13 @@ REVOKE ALL PRIVILEGES ON tenant_table FROM PUBLIC;
6862
-- fail, these objects belonging to regress_tenant
6963
SET SESSION AUTHORIZATION regress_createrole;
7064
DROP INDEX tenant_idx;
71-
ERROR: must be owner of index tenant_idx
7265
ALTER TABLE tenant_table ADD COLUMN t text;
73-
ERROR: must be owner of table tenant_table
7466
DROP TABLE tenant_table;
75-
ERROR: must be owner of table tenant_table
7667
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"
7869
DROP VIEW tenant_view;
79-
ERROR: must be owner of view tenant_view
8070
-- fail, cannot take ownership of these objects from regress_tenant
8171
REASSIGN OWNED BY regress_tenant TO regress_createrole;
82-
ERROR: permission denied to reassign objects
8372
-- ok, having CREATEROLE is enough to create roles in privileged roles
8473
CREATE ROLE regress_read_all_data IN ROLE pg_read_all_data;
8574
ERROR: permission denied to grant role "pg_read_all_data"
@@ -140,9 +129,7 @@ DROP ROLE regress_encrypted_password;
140129
DROP ROLE regress_password_null;
141130
DROP ROLE regress_noiseword;
142131
DROP ROLE regress_inroles;
143-
ERROR: role "regress_inroles" does not exist
144132
DROP ROLE regress_adminroles;
145-
ERROR: role "regress_adminroles" does not exist
146133
DROP ROLE regress_rolecreator;
147134
DROP ROLE regress_read_all_data;
148135
ERROR: role "regress_read_all_data" does not exist
@@ -166,9 +153,6 @@ DROP ROLE regress_signal_backend;
166153
ERROR: role "regress_signal_backend" does not exist
167154
-- fail, role still owns database objects
168155
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
172156
-- fail, cannot drop ourself nor superusers
173157
DROP ROLE regress_role_super;
174158
ERROR: must be superuser to drop superusers
@@ -177,8 +161,12 @@ ERROR: current user cannot be dropped
177161
-- ok
178162
RESET SESSION AUTHORIZATION;
179163
DROP INDEX tenant_idx;
164+
ERROR: index "tenant_idx" does not exist
180165
DROP TABLE tenant_table;
166+
ERROR: table "tenant_table" does not exist
181167
DROP VIEW tenant_view;
168+
ERROR: view "tenant_view" does not exist
182169
DROP ROLE regress_tenant;
170+
ERROR: role "regress_tenant" does not exist
183171
DROP ROLE regress_role_admin;
184172
DROP ROLE regress_role_super;

0 commit comments

Comments
 (0)