Force client disconnect using PostgreSQL

前端 未结 6 1099
轮回少年
轮回少年 2020-12-25 11:33

Is there a way to force clients to disconnect from PostgreSQL? I\'m looking for the equivlent of DB2\'s force application all.

I\'d like to do this on my development

6条回答
  •  萌比男神i
    2020-12-25 11:44

    Kills idle processes in PostgreSQL 8.4:

    SELECT procpid, (SELECT pg_terminate_backend(procpid)) as killed from pg_stat_activity
       WHERE current_query LIKE '';
    

提交回复
热议问题