Database Design
Lis Sulmont
Curriculum Manager
GRANT privilege(s)
or REVOKE privilege(s)
ON object
TO role
or FROM role
SELECT
, INSERT
, UPDATE
, DELETE
, etc.GRANT UPDATE ON ratings TO PUBLIC;
REVOKE INSERT ON films FROM db_user;
CREATE ROLE data_analyst;
CREATE ROLE intern WITH PASSWORD 'PasswordForIntern' VALID UNTIL '2020-01-01';
CREATE ROLE admin CREATEDB;
ALTER ROLE admin CREATEROLE;
GRANT UPDATE ON ratings TO data_analyst;
REVOKE UPDATE ON ratings FROM data_analyst;
The available privileges in PostgreSQL are:
SELECT
, INSERT
, UPDATE
, DELETE
, TRUNCATE
, REFERENCES
, TRIGGER
, CREATE
, CONNECT
, TEMPORARY
, EXECUTE
, and USAGE
CREATE ROLE data_analyst;
CREATE ROLE intern WITH PASSWORD 'PasswordForIntern' VALID UNTIL '2020-01-01';
CREATE ROLE data_analyst;
CREATE ROLE alex WITH PASSWORD 'PasswordForIntern' VALID UNTIL '2020-01-01';
GRANT data_analyst TO alex;
REVOKE data_analyst FROM alex;
Role | Allowed access |
---|---|
pg_read_all_settings | Read all configuration variables, even those normally visible only to superusers. |
pg_read_all_stats | Read all pg_stat_* views and use various statistics related extensions, even those normally visible only to superusers. |
pg_signal_backend | Send signals to other backends (eg: cancel query, terminate). |
More... | More... |
Database Design