postgresql 如何退出 psql 中的查询结果查看器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34475078/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to exit from query result viewer in psql?
提问by Иван Петров
First query:
第一个查询:
database=# select * from table limit 1;
...
|
(1 row)
(END)
I want to make a second query but I can't. ctrl+Z exits from psql. What can I press to exit only from result viewing?
我想进行第二次查询,但我不能。ctrl+Z 从 psql 退出。我可以按什么来仅从结果查看中退出?
回答by andreas-hofmann
Hit q. This closes many vim-like views, not only in psql, but also e.g. in 'less', 'git log', 'mutt', and many more.
击中q。这关闭了许多类似 vim 的视图,不仅在 psql 中,而且在例如 'less'、'git log'、'mutt' 等中。
Just FYI: Hitting Ctrl+ Zdoes not exit psql, it just suspends it and sends it to background. The program continues to run, and you can resume it by entering 'fg'. In Unix environments, Ctrl+ Cis usually the way to forcibly stop a program.
仅供参考:点击Ctrl+Z不会退出 psql,它只是暂停它并将其发送到后台。程序继续运行,您可以通过输入“fg”来恢复它。在 Unix 环境中,Ctrl+C通常是强制停止程序的方式。