Restrict CREATEROLE privilege grant to NOLOGIN only?

From: "Alexander M(dot) Sauer-Budge" <ambudge(at)alum(dot)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Restrict CREATEROLE privilege grant to NOLOGIN only?
Date: 2016-08-18 18:02:20
Message-ID: A30FDF8F-25AC-4D16-BEB0-1B8D21ECDEC3@alum.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it possible to create a login user who themselves can CREATE ROLE NOLOGIN but not CREATE ROLE LOGIN? Here’s an example of the behavior I’d like to achieve.

$ psql
postgres=> CREATE USER admin WITH PASSWORD 'mypassword' CREATEROLE;
postgres=> — revoke something?
postgres=> \q

$ psql -U admin -W
postgres=> CREATE ROLE myrole;
CREATE ROLE
postgres=> CREATE USER myuser WITH PASSWORD '1234’;
ERROR: permission denied to create role

Of course, as written the final “CREATE USER” statement succeeds in reality.

Thanks,
Alex

Browse pgsql-general by date

  From Date Subject
Next Message gilad905 2016-08-18 19:08:14 Re: Easiest way to compare the results of two queries row by row and column by column
Previous Message Manuel Gómez 2016-08-18 17:59:36 Re: foreign key with where clause