CREATE USER (USER_NAME) PASSWORD 'PASSWORD' SUPERUSER;
ex) moonpiderman 이라는 user를 moonpiderman 이라는 pw로 superuser 생성하기
CREATE USER moonpiderman PASSWORD 'moonpiderman' SUPERUSER;
ALTER USER (USER_NAME) (줄_권한);
ex) moonpiderman 에게 create DB 권한 부여
ALTER USER moonpiderman CREATEDB;
CRAETE DATABASE (DB_NAME) WITH OWNER (USER_NAME) ENCODING 'UTF8';
ex) moonpiderman이 오너가 되는 my_db 생성
CREATE DATABASE my_db WITH OWNER moonpiderman ENCODING 'UTF8';
GRANT ALL PRIVILEGES ON DATABASE (DB_NAME) TO (USER_NAME);
ex) moonpiderman 에게 my_db 데이터베이스에 모든 권한 부여
GRANT ALL PRIVILEGES ON DATABASE my_db TO moonpiderman;