Postgresql Users
Active connections 1 SELECT pid, usename, datname, application_name FROM pg_stat_activity WHERE usename = 'user_name'; Force user logout 1 2 3 4 5 6 REVOKE CONNECT ON DATABASE db_name FROM PUBLIC; SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'db_name' AND pid <> pg_backend_pid(); Change Password 1 ALTER ROLE rol_name WITH PASSWORD 'nueva_contraseña'; If you are changing the password for the role you are connected with, you can use: 1 \password role_name To verify that the password has been changed successfully, you can check the roles in the pg_roles table:...