如何从 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:58:49  来源:igfitidea点击:

How can I exit/logout from PostgreSQL?

postgresqlcommand-lineubuntu-14.04psql

提问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 \qand press enterto quit from psql from command line. In general the meta commands are preceded by \for eg- \listor \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 psqlconsider referring to the documentation here

由于您是新手,可以psql考虑参考此处的文档