Answers for "There is 1 other session using the database, postgres"

SQL
2

There is 1 other session using the database, postgres

SELECT 
    pg_terminate_backend(pid) 
FROM 
    pg_stat_activity 
WHERE 
    -- don't kill my own connection!
    pid <> pg_backend_pid()
    -- don't kill the connections to other databases
    AND datname = 'database_name'
    ;
Posted by: Guest on June-22-2020

Code answers related to "There is 1 other session using the database, postgres"

Code answers related to "SQL"

Browse Popular Code Answers by Language