ALTER DEFAULT PRIVILEGES

An SQL command for defining default object access privileges

ALTER DEFAULT PRIVILEGES is an SQL command for defining default object access privileges.

ALTER DEFAULT PRIVILEGES was introduced in PostgreSQL 9.0 (commit 249724cb).

Examples

postgres=# CREATE SCHEMA someschema;
CREATE SCHEMA
postgres=# ALTER DEFAULT PRIVILEGES IN SCHEMA someschema GRANT SELECT ON TABLES TO foo; ALTER DEFAULT PRIVILEGES
postgres=# \ddp Default access privileges Owner | Schema | Type | Access privileges ----------+------------+-------+------------------- postgres | someschema | table | foo=r/postgres (1 row)

Categories

DDL

See also

pg_default_acl