To temporarily prevent the user from logging in, run this command:
pguser=# alter user bob nologin;ALTER ROLE
To let the user connect again, run the following:
pguser=# alter user bob login;ALTER ROLE
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.