select * from pg_roles;
CREATE ROLE name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT connlimit
| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
CREATE ROLE role_admin SUPERUSER CREATEDB CREATEROLE
NOINHERIT NOLOGIN REPLICATION CONNECTION LIMIT -1; # 관리자 역할
CREATE ROLE role_advanced_developer NOLOGIN CONNECTION LIMIT 10;
CREATE ROLE role_developer NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_manager NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_application NOLOGIN CONNECTION LIMIT 20;
grant USAGE on schema 스키마이름 to role_manager, role_developer, role_advanced_developer, role_admin;
revoke role_advanced_developer from seongho_park;
select * from information_schema.table_privileges where grantee = 'role_manager' and table_schema ='schema_name';
select * from information_schema.table_privileges where grantee = 'some_user' and table_schema ='schema_name';
select * from pg_shadow;
CREATE USERname [ [ WITH ]option [ ... ] ]
whereoption can be:
SYSIDuid
| CREATEDB | NOCREATEDB
| CREATEUSER | NOCREATEUSER
| IN GROUPgroupname [, ...]
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
| VALID UNTIL 'abstime'
CREATE USER seongho_park
WITH PASSWORD 'dddssadft' # 패스원드 추가 옵션
VALID UNTIL '2005-01-01'; # 추가로 만료기간 옵션
select * from information_schema.table_privileges where table_schema = '확인할 스키마 이름';
select * from pg_roles;
CREATE ROLE name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT connlimit
| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
CREATE ROLE role_admin SUPERUSER CREATEDB CREATEROLE
NOINHERIT NOLOGIN REPLICATION CONNECTION LIMIT -1; # 관리자 역할
CREATE ROLE role_advanced_developer NOLOGIN CONNECTION LIMIT 10;
CREATE ROLE role_developer NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_manager NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_application NOLOGIN CONNECTION LIMIT 20;
grant USAGE on schema 스키마이름 to role_manager, role_developer, role_advanced_developer, role_admin;
revoke role_advanced_developer from seongho_park;
select * from information_schema.table_privileges where grantee = 'role_manager' and table_schema ='schema_name';
select * from information_schema.table_privileges where grantee = 'some_user' and table_schema ='schema_name';
select * from pg_shadow;
CREATE USERname [ [ WITH ]option [ ... ] ]
whereoption can be:
SYSIDuid
| CREATEDB | NOCREATEDB
| CREATEUSER | NOCREATEUSER
| IN GROUPgroupname [, ...]
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
| VALID UNTIL 'abstime'
CREATE USER seongho_park
WITH PASSWORD 'dddssadft' # 패스원드 추가 옵션
VALID UNTIL '2005-01-01'; # 추가로 만료기간 옵션
select * from information_schema.table_privileges where table_schema = '확인할 스키마 이름';
select * from pg_roles;
CREATE ROLE name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT connlimit
| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
CREATE ROLE role_admin SUPERUSER CREATEDB CREATEROLE
NOINHERIT NOLOGIN REPLICATION CONNECTION LIMIT -1; # 관리자 역할
CREATE ROLE role_advanced_developer NOLOGIN CONNECTION LIMIT 10;
CREATE ROLE role_developer NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_manager NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_application NOLOGIN CONNECTION LIMIT 20;
grant USAGE on schema 스키마이름 to role_manager, role_developer, role_advanced_developer, role_admin;
revoke role_advanced_developer from seongho_park;
select * from information_schema.table_privileges where grantee = 'role_manager' and table_schema ='schema_name';
select * from information_schema.table_privileges where grantee = 'some_user' and table_schema ='schema_name';
select * from pg_shadow;
CREATE USERname [ [ WITH ]option [ ... ] ]
whereoption can be:
SYSIDuid
| CREATEDB | NOCREATEDB
| CREATEUSER | NOCREATEUSER
| IN GROUPgroupname [, ...]
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
| VALID UNTIL 'abstime'
CREATE USER seongho_park
WITH PASSWORD 'dddssadft' # 패스원드 추가 옵션
VALID UNTIL '2005-01-01'; # 추가로 만료기간 옵션
select * from information_schema.table_privileges where table_schema = '확인할 스키마 이름';
select * from pg_roles;
CREATE ROLE name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT connlimit
| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
CREATE ROLE role_admin SUPERUSER CREATEDB CREATEROLE
NOINHERIT NOLOGIN REPLICATION CONNECTION LIMIT -1; # 관리자 역할
CREATE ROLE role_advanced_developer NOLOGIN CONNECTION LIMIT 10;
CREATE ROLE role_developer NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_manager NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_application NOLOGIN CONNECTION LIMIT 20;
grant USAGE on schema 스키마이름 to role_manager, role_developer, role_advanced_developer, role_admin;
revoke role_advanced_developer from seongho_park;
select * from information_schema.table_privileges where grantee = 'role_manager' and table_schema ='schema_name';
select * from information_schema.table_privileges where grantee = 'some_user' and table_schema ='schema_name';
select * from pg_shadow;
CREATE USERname [ [ WITH ]option [ ... ] ]
whereoption can be:
SYSIDuid
| CREATEDB | NOCREATEDB
| CREATEUSER | NOCREATEUSER
| IN GROUPgroupname [, ...]
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
| VALID UNTIL 'abstime'
CREATE USER seongho_park
WITH PASSWORD 'dddssadft' # 패스원드 추가 옵션
VALID UNTIL '2005-01-01'; # 추가로 만료기간 옵션
select * from information_schema.table_privileges where table_schema = '확인할 스키마 이름';
select * from pg_roles;
CREATE ROLE name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT connlimit
| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
CREATE ROLE role_admin SUPERUSER CREATEDB CREATEROLE
NOINHERIT NOLOGIN REPLICATION CONNECTION LIMIT -1; # 관리자 역할
CREATE ROLE role_advanced_developer NOLOGIN CONNECTION LIMIT 10;
CREATE ROLE role_developer NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_manager NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_application NOLOGIN CONNECTION LIMIT 20;
grant USAGE on schema 스키마이름 to role_manager, role_developer, role_advanced_developer, role_admin;
revoke role_advanced_developer from seongho_park;
select * from information_schema.table_privileges where grantee = 'role_manager' and table_schema ='schema_name';
select * from information_schema.table_privileges where grantee = 'some_user' and table_schema ='schema_name';
select * from pg_shadow;
CREATE USERname [ [ WITH ]option [ ... ] ]
whereoption can be:
SYSIDuid
| CREATEDB | NOCREATEDB
| CREATEUSER | NOCREATEUSER
| IN GROUPgroupname [, ...]
| [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
| VALID UNTIL 'abstime'
CREATE USER seongho_park
WITH PASSWORD 'dddssadft' # 패스원드 추가 옵션
VALID UNTIL '2005-01-01'; # 추가로 만료기간 옵션
select * from information_schema.table_privileges where table_schema = '확인할 스키마 이름';
select * from pg_roles;
CREATE ROLE name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE | NOCREATEROLE
| INHERIT | NOINHERIT
| LOGIN | NOLOGIN
| REPLICATION | NOREPLICATION
| BYPASSRLS | NOBYPASSRLS
| CONNECTION LIMIT connlimit
| [ ENCRYPTED ] PASSWORD 'password' | PASSWORD NULL
| VALID UNTIL 'timestamp'
| IN ROLE role_name [, ...]
| IN GROUP role_name [, ...]
| ROLE role_name [, ...]
| ADMIN role_name [, ...]
| USER role_name [, ...]
| SYSID uid
CREATE ROLE role_admin SUPERUSER CREATEDB CREATEROLE
NOINHERIT NOLOGIN REPLICATION CONNECTION LIMIT -1; # 관리자 역할
CREATE ROLE role_advanced_developer NOLOGIN CONNECTION LIMIT 10;
CREATE ROLE role_developer NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_manager NOLOGIN CONNECTION LIMIT 5;
CREATE ROLE role_application NOLOGIN CONNECTION LIMIT 20;
grant USAGE on schema 스키마이름 to role_manager, role_developer, role_advanced_developer, role_admin;
revoke role_advanced_developer from seongho_park;
select * from information_schema.table_privileges where grantee = 'role_manager' and table_schema ='schema_name';
select * from information_schema.table_privileges where grantee = 'some_user' and table_schema ='schema_name';