CREATE USER mynewuser PASSWORD 'mynewpassword';
DROP USER mynewuser;
- SUPERUSER/NOSUPERUSER
- CREATEDB/NOCREATEDB
- CREATEROLE/NOCREATEROLE
- CREATEUSER/NOCREATEUSER
- LOGIN/NOLOGIN
- PASSWORD
- VALID UNTIL
ALTER ROLE <rol name> WITH <options>;
-- Example
ALTER ROLE mynewuser WITH SUPERUSER;
ALTER ROLE mynewuser WITH PASSWORD 'mynewpassword';
CREATE DATABASE mydatabase WITH OWNER mynewuser;
GRANT ALL PRIVILEGES ON DATABASE mydatabase TO mynewuser;