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.

asked Nov 15, 2021 at 19:05
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.

answered Nov 16, 2021 at 7:58
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. Commented Nov 16, 2021 at 8:46

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.