Roles and Privileges (Postgres, Greenplum, Deepgreen)

Privileges

  List privileges Full privileges Default privileges
Database \l CTc (Create, Temporary, connect) Tc (Temporary, connect)
Schema \dn+ UC (Usage, Create) none
Table \dp arwdDxt (append,read,write,delete,truncate,reference,trigger) none

 

Examples:

  • Update pg_hba.conf to allow user "tom" to access database "sales" from IP "10.0.0.5"
    • host sales tom 10.0.0.5/32 password
  • Allow user "tom" to read table "crm.customer_dim"
    • GRANT USAGE ON SCHEMA crm TO tom;
    • GRANT SELECT ON TABLE customer_dim TO tom;
  • Remove above privileges
    • REVOKE SELECT ON TABLE customer_dim FROM tom;
    • REVOKE USAGE ON SCHEMA crm FROM tom;

Reference:

  • https://www.postgresql.org/docs/12/ddl-priv.html

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer