Friday, November 11, 2011

Postgresql - Looking at database objects permissions

From man psql

\z [ pattern ]
Lists tables, views and sequences with their associated access privileges. If a pattern is
specified, only tables, views and sequences whose names match the pattern are listed.

This is an alias for \dp (“display privileges”).


Decoding the output:

Psql - show permissions on database objects
=> \z [object]
r -- SELECT ("read")
w -- UPDATE ("write")
a -- INSERT ("append")
d -- DELETE
R -- RULE
x -- REFERENCES (foreign keys)
t -- TRIGGER
X -- EXECUTE
U -- USAGE
C -- CREATE
T -- TEMPORARY
arwdRxt -- ALL PRIVILEGES (for tables)
* -- grant option for preceding privilege
/yyyy -- user who granted this privilege
----

As simple as that.

No comments:

Post a Comment