We also need to understand acl entries of the following format:
grantee=privilege-abbreviation[*]/grantor
e.g. in the following dp+ acl example user has been given all permissions by postgres role
user=arwdDxt/postgres
If the “grantee” column is empty for a given object, it means the object has default owner privileges (all privileges) or it can mean privileges to PUBLIC role (every role that exists)
=UC/postgres
Also it's confusing when Public schema is used. You have CREATE permission on schema so when the tables are created with the same user you select data with and you have owner permissions out of the box.
2
Answers
PostgreSQL has 3 layers of objects (Database, Schema, objects e.g. Tables) and also implicit grants given to DB object owners
That means we need
To see these privileges:
l+
to see privileges of Databasedn+
to see privileges of Schemasdp+
to see privileges of TablesPrivileges are seen here
We also need to understand acl entries of the following format:
e.g. in the following
dp+
acl exampleuser
has been given all permissions bypostgres
roleIf the “grantee” column is empty for a given object, it means the object has default owner privileges (all privileges) or it can mean privileges to
PUBLIC
role (every role that exists)Also it's confusing when Public schema is used. You have CREATE permission on schema so when the tables are created with the same user you select data with and you have owner permissions out of the box.
That’s correct and complete; the only exception is that there is no
USAGE
privilege on databases, so you don’t need that.