LoginSignup
0
0

More than 5 years have passed since last update.

Permissions for DB

Last updated at Posted at 2018-05-23

Permissions for DB

DB

  • Role
  • Kinds of permissions for DB
  • Setting/Deleting permissions

Role

  • Super user ** Has a mighty permission ** Creates general roles and their permissions

Creation/Deletion of a role

CREATE ROLE|USER role [[WITH] attribute [...]];
ALTER ROLE role [[WITH] attribute [...]];
DROP ROLE|USER role [...];

Main attributes:
* LOGIN/NOLOGIN
* SUPERUSER/NOSUPERUSER
* CREATEDB/NOCREATEDB
* CREATEROLE/NOCREATEROLE
* [ENCRYPTED] PASSWORD ‘password.’

Granting/Revoking permissions

GRANT permission ON object TO user;
REVOKE permission ON object FROM user;

Examples

GRANT CONNECT ON DATABASE db00 TO dbtrainee;
REVOKE DELETE ON product FROM dbtrainee;
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0