Answers for "postgre kill all existing connections"

SQL
1

postgres kill all connections

SELECT 
    pg_terminate_backend(pid) 
FROM 
    pg_stat_activity 
WHERE 
    pid <> pg_backend_pid()
    AND datname = 'database_name';
Posted by: Guest on July-20-2020

Code answers related to "postgre kill all existing connections"

Code answers related to "SQL"

Browse Popular Code Answers by Language