aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-01-11 12:22:47 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2023-01-11 12:22:47 -0500
commitd0d968328794a25c844dc57585d0289a08159bb5 (patch)
treea5a878c0010a41627617bba08f53eb80f77b1467 /src
parentc971a5b27ac946e7c94f7f655d321279512c7ee7 (diff)
downloadpostgresql-d0d968328794a25c844dc57585d0289a08159bb5.tar.gz
postgresql-d0d968328794a25c844dc57585d0289a08159bb5.zip
Don't leave roles behind after core regression tests.
Commits cf5eb37c5 and e5b8a4c09 each created a new role that they forgot to remove again. This breaks the use-case of running "make installcheck" more than once, and it's also against project policy because it'd be quite unfriendly behavior if one were running "make installcheck" against a non-throwaway installation.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/create_role.out7
-rw-r--r--src/test/regress/sql/create_role.sql6
2 files changed, 11 insertions, 2 deletions
diff --git a/src/test/regress/expected/create_role.out b/src/test/regress/expected/create_role.out
index bed37498889..cd49feabb3a 100644
--- a/src/test/regress/expected/create_role.out
+++ b/src/test/regress/expected/create_role.out
@@ -174,18 +174,23 @@ DROP ROLE regress_password_null;
DROP ROLE regress_noiseword;
DROP ROLE regress_inroles;
DROP ROLE regress_adminroles;
--- fail, cannot drop ourself nor superusers
+-- fail, cannot drop ourself, nor superusers or roles we lack ADMIN for
DROP ROLE regress_role_super;
ERROR: must be superuser to drop superusers
DROP ROLE regress_role_admin;
ERROR: current user cannot be dropped
+DROP ROLE regress_rolecreator;
+ERROR: must have admin option on role "regress_rolecreator"
-- ok
RESET SESSION AUTHORIZATION;
REVOKE CREATE ON DATABASE regression FROM regress_role_admin CASCADE;
DROP INDEX tenant_idx;
DROP TABLE tenant_table;
DROP VIEW tenant_view;
+DROP SCHEMA regress_tenant2_schema;
DROP ROLE regress_tenant;
+DROP ROLE regress_tenant2;
+DROP ROLE regress_rolecreator;
DROP ROLE regress_role_admin;
DROP ROLE regress_role_super;
DROP ROLE regress_role_normal;
diff --git a/src/test/regress/sql/create_role.sql b/src/test/regress/sql/create_role.sql
index edaed43588b..6b90336da2e 100644
--- a/src/test/regress/sql/create_role.sql
+++ b/src/test/regress/sql/create_role.sql
@@ -161,9 +161,10 @@ DROP ROLE regress_noiseword;
DROP ROLE regress_inroles;
DROP ROLE regress_adminroles;
--- fail, cannot drop ourself nor superusers
+-- fail, cannot drop ourself, nor superusers or roles we lack ADMIN for
DROP ROLE regress_role_super;
DROP ROLE regress_role_admin;
+DROP ROLE regress_rolecreator;
-- ok
RESET SESSION AUTHORIZATION;
@@ -171,7 +172,10 @@ REVOKE CREATE ON DATABASE regression FROM regress_role_admin CASCADE;
DROP INDEX tenant_idx;
DROP TABLE tenant_table;
DROP VIEW tenant_view;
+DROP SCHEMA regress_tenant2_schema;
DROP ROLE regress_tenant;
+DROP ROLE regress_tenant2;
+DROP ROLE regress_rolecreator;
DROP ROLE regress_role_admin;
DROP ROLE regress_role_super;
DROP ROLE regress_role_normal;