Inspecting permissions
When all of the permissions have been set, it is sometimes necessary to know who has which permissions. It is vital for administrators to find out who is allowed to do what. Unfortunately, this process is not so easy and requires a bit of knowledge. Usually, I am a big fan of command-line usage. However, in the case of the permission system, it can really make sense to use a graphical user interface to do things.
Before I show you how to read PostgreSQL permissions, let’s assign rights to the role named joe
so that we can inspect them in the next step:
test=# GRANT ALL ON t_person TO joe; GRANT
Information about permissions can be retrieved using the z
command in psql
:
test=# \x Expanded display is on. test=# \z t_person Access privileges -[ RECORD 1 ]-----+------------------------------------------------------------ Schema | public Name ...