오라클에서는 alter user scott account lock; 명령으로 scott 계정을 락킹할수 있습니다.
그러면 scott 계정으로 오라클에 로그인이 불가능합니다.
PostgreSQL 에서는 어떻게 할까요?
superuser 권한 유저로 다음과 같은 명령을 내리면 됩니다.
postgres=# alter user scott connection limit 0;
ALTER ROLE
postgres=#
scott 유저로 PostgreSQL 로그인 시도시에 아래와 같은 에러가 발생합니다.
psql: FATAL: too many connections for role "scott"
다시 로그인 가능하도록 하려면 다음과 같이 합니다.
alter user scott connection limit -1;