Re: Role Granting Issues in PostgreSQL: Need Help - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Role Granting Issues in PostgreSQL: Need Help
Date
Msg-id CAKFQuwYHvmti+8E3kATV6Qh33_XiA+HDYCvMHfhmSX=iUxPEgA@mail.gmail.com
Whole thread Raw
In response to Role Granting Issues in PostgreSQL: Need Help  (Muhammad Imtiaz <imtiazpg712@gmail.com>)
Responses Re: Role Granting Issues in PostgreSQL: Need Help
List pgsql-hackers
On Wednesday, September 4, 2024, Muhammad Imtiaz <imtiazpg712@gmail.com> wrote:

1. Create a role with specific permissions

CREATE ROLE rep_admin WITH LOGIN CREATEDB CREATEROLE REPLICATION;

                                         List of roles
     Role name      |                         Attributes                         | Description
--------------------+------------------------------------------------------------+-------------
 postgres           | Superuser, Create role, Create DB, Replication, Bypass RLS |
 rep_admin          | Create role, Create DB, Replication                        |
 replication_expert | Cannot login  


6.Examine the pg_roles table to confirm that the permissions for replication_expert have not been updated:

postgres=# SELECT rolname,rolinherit, rolcreaterole, rolcreatedb, rolcanlogin,rolreplication
FROM pg_roles where rolname in('rep_admin','replication_expert');;
      rolname       | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication
--------------------+------------+---------------+-------------+-------------+----------------
 rep_admin          | t          | t             | t           | t           | t
 replication_expert | t          | f             | f           | f           | f
(2 rows)


Those are not permissions, they are attributes, and attributes are not inherited.

David J.

pgsql-hackers by date:

Previous
From: Muhammad Imtiaz
Date:
Subject: Role Granting Issues in PostgreSQL: Need Help
Next
From: Tom Lane
Date:
Subject: Re: Role Granting Issues in PostgreSQL: Need Help