540 B
540 B
Get list of users and numbers of active connections
SELECT
datname AS database_name,
usename AS user_name,
count(*) AS active_connections
FROM pg_stat_activity
GROUP BY datname, usename order by active_connections DESC;
Limit number of connections for user
alter user keycloak connection limit 80;ALTER ROLE
Remove limit number of connections for user
alter user keycloak connection limit -1;ALTER ROLE
Get replication status
select * from pg_stat_replication;