0

The documentation says:

Any particular role will have the sum of privileges granted directly to it, privileges granted to any role it is presently a member of, and privileges granted to PUBLIC.

How to get to know from psql CLI which privileges are granted to PUBLIC?

\du seems to list all roles but it lacks a row for PUBLIC. I would expect it to be very easy and intuitive to find out which permissions a newly created role gets by default.

1

1 Answer 1

0

There is no easy way to get all privileges granted to PUBLIC (or any other role, for that matter). You would have to scan the ACLs of all objects.

1
  • I was a bit confused about the privileges terminology. The documentation (at postgresql.org/docs/14/role-attributes.html) says: "A database role can have a number of attributes that define its privileges". These are the privileges I meant in my question - the ones associated with the role. Like whether it has a login privilege or not. But now I get it - PUBLIC itself does not have any attributes but DB objects like tables can have roles and groups, including PUBLIC, to do something with them like select or insert.
    – alvarez
    Nov 16, 2021 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.