May 2019
Intermediate to advanced
600 pages
20h 46m
English
In order to make sure that all users whose login privileges have been revoked are disconnected right away, run the following SQL statement as a superuser:
SELECT pg_terminate_backend(pid) FROM pg_stat_activity a JOIN pg_roles r ON a.usename = r.rolname AND NOT rolcanlogin;
This disconnects all users who no longer are allowed to connect by terminating the backends opened by these users.
Read now
Unlock full access