PostgreSQL db, schema, user, role 생성


PostgreSQL db, schema, user, role 생성

PostgreSQL을 설치하면 default user로 postgres가 생성되며 superuser 권한을 가진다. 여기에 database를 생성하면 default schema로 public schema가 생성되며 모든 user가 객체를 생성할 수 있다. 따라서 user가 public schema에서 객체를 생성할 수 없도록 하고 신규 database와 schema를 생성해보자. # public schema revoke revoke all privileges on schema public FROM public; # user 생성 create user {user} with password '{password}'; # db 생성 create database {database} owner {user}; # d..


원문링크 : PostgreSQL db, schema, user, role 생성