如何从 PostgreSQL 退出/注销?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30432288/
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 can I exit/logout from PostgreSQL?
提问by Vajira Lasantha
I'm new to psql and using psql command line on Ubuntu. What is the command to logout/exit from command line?
我是 psql 的新手,并在 Ubuntu 上使用 psql 命令行。从命令行注销/退出的命令是什么?
Thank you!
谢谢!
回答by inquisitive
type \q
and press enter
to quit from psql from command line. In general the meta commands are preceded by \
for eg- \list
or \l
: list all databases or \dt
: list all tables in the current database
键入\q
并按enter
从命令行退出 psql。通常,元命令前面是\
for eg-\list
或\l
:列出所有数据库或\dt
:列出当前数据库中的所有表
To switch databases:
切换数据库:
\connect database_name
\connect database_name
If that does not work, you can use CTRL
+ D
. For more help on meta commands you can press \?
如果这不起作用,您可以使用CTRL
+ D
。有关元命令的更多帮助,您可以按\?
Since you are new to psql
consider referring to the documentation here
由于您是新手,可以psql
考虑参考此处的文档