根据线程ID结束会话。
SELECT pg_terminate_backend(139834762094352);
显示类似如下信息,表示结束会话成功。
pg_terminate_backend
---------------------
t
(1 row)
显示类似如下信息,表示用户正在尝试结束当前会话,此时仅会重连会话,而不是结束会话。
FATAL: terminating connection due to administrator command
FATAL: terminating connection due to administrator command The connection to the server was lost. Attempting reset: Su