After altering the default privileges on a Postgres database object, how can you view them?
For instance, if you grant all privileges to role_name
for all tables created in the schema schema_name
:
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT ALL ON TABLES TO role_name;
There is another way, at least in recent Postgres versions.
Use the \ddp
command
Default access privileges
Owner | Schema | Type | Access privileges
----------------+--------+----------+-------------------
role_x | | function | =X/role_x
role_x | | sequence |
role_x | | table |
role_x | | type | =U/role_x
Read more about it under the Notes section here:
http://www.postgresql.org/docs/current/static/sql-alterdefaultprivileges.html