列出 PostgreSQL 数据表中的所有条目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12902581/
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
List all entries in a PostgreSQL datatable
提问by FluxEngine
While using the psql in the command line, how do I view all entries in a datatable?
在命令行中使用 psql 时,如何查看数据表中的所有条目?
The database name is newproject.
数据库名称是 newproject。
newproject=#
I have tried \l (but this list all the databases)
我试过 \l (但是这个列出了所有的数据库)
I am trying to see all the entries in the datatable. I am trying to verify that the test entries I have been putting in from my web app are storing correctly.
我正在尝试查看数据表中的所有条目。我正在尝试验证我从 Web 应用程序放入的测试条目是否正确存储。
回答by Vincent Savard
If I recall correctly, \dt
will show all tables in the database. Anyway, you can type \?
to show available commands.
如果我没记错的话,\dt
会显示数据库中的所有表。无论如何,您可以键入\?
以显示可用命令。
Selecting every row in a table is just a basic SQL command :
选择表中的每一行只是一个基本的 SQL 命令:
SELECT * FROM your_table;