User Management
the following definitions:
- roles; a user of a group of users.
- role attributes;
With roles, privileges and restriction privileges and restrictions can be set on the level of Databases, Tables and Columns.
common attributes assigned to users:
SUPERUSER: roles with this attribute can create anotherSUPERUSER. Since roles with this attribute bypass all permission checks, grant this privilege judiciously.CREATEDB: Allows the role to create databases.CREATEROLE: with this attribitute, the role can create other roles.LOGIN: a role name with this attribute can be used in the client connection command.
Create a role with a password and the ability to login and then ALTER the role with attributes CREATEROLE and CREATEDB.
CREATE ROLE log_user WITH LOGIN PASSWORD 'pass2';
ALTER ROLE log_user CREATEROLE CREATEDB;
Resources
- PostgreSQL Privileges & User Management - What You Should Know by Joshua Otwell