Ensure that the superuser should be able to create database and role, as the superuser

overrides all the access restrictions.
Fixes #4792 Fixes #4878
This commit is contained in:
Akshay Joshi
2019-11-14 18:14:53 +05:30
parent b7d7bda93a
commit f22134dabd
2 changed files with 4 additions and 1 deletions

View File

@@ -492,7 +492,8 @@ WHERE db.datname = current_database()""")
status = _execute(cur, """
SELECT
oid as id, rolname as name, rolsuper as is_superuser,
rolcreaterole as can_create_role, rolcreatedb as can_create_db
CASE WHEN rolsuper THEN true ELSE rolcreaterole END as can_create_role,
CASE WHEN rolsuper THEN true ELSE rolcreatedb END as can_create_db
FROM
pg_catalog.pg_roles
WHERE