无法逃脱卡住的命令行

时间:2019-12-18 20:38:56

标签: psql

这就是我所拥有的:

company=# SELECT * FROM drivers WHERE id=14 LIMIT 1;


^CCancel request sent
^[[A


^[[A^[[A^[[B^[[B
^CCancel request sent
^CCancel request sent
exit()
exit



^CCancel request sent

尝试了exitexit()和CTRL + C,但没有结果。帮助。

1 个答案:

答案 0 :(得分:0)

使用此:

SELECT * FROM pg_stat_activity WHERE state = 'active';

获取挂起/要取消的进程。

然后:

如果您想终止正在挂起且无响应的进程     使用:

SELECT pg_terminate_backend(<pid of the process>)

如果您只想取消某个流程,请使用:

SELECT pg_cancel_backend(<pid of the process>)

您还可以选中this doc for more information