postgresql PostgreSql命令查看表数据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9178406/
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
PostgreSql command to see the table data
提问by Amit Singh Tomar
I am new in PostgreSql. I import the database on my linux machine. I am able to see the list of tables using \d command (GSM_test_db-# \d default_msg_details
) its displaying the table list but I want to see the table data.
我是 PostgreSql 的新手。我在我的 linux 机器上导入数据库。我可以使用 \d 命令 ( GSM_test_db-# \d default_msg_details
) 查看表格列表,它显示表格列表,但我想查看表格数据。
Any Command that shows table Data also Please tell me.
任何显示表数据的命令也请告诉我。
I already used select query GSM_test_db-# SELECT * FROM default_msg_details
but its not displaying anything and its not giving any error.
我已经使用了选择查询,GSM_test_db-# SELECT * FROM default_msg_details
但它没有显示任何内容,也没有给出任何错误。
Please tell me if any command or why this select its not displaying anything.
请告诉我是否有任何命令或为什么选择它不显示任何内容。
回答by Klaus Byskov Pedersen
Because you need to terminate your statement with a ;
因为你需要用 ;
回答by Lisa
Try SELECT * FROM "default_msg_details";
尝试 SELECT * FROM "default_msg_details";
Beside adding ";" at the end of your query, you also need add the quotes("") to your tabel's name as well.
除了添加“;” 在查询结束时,您还需要将引号 ("") 添加到您的表格名称中。
回答by Sajjadmanal
Firstly, you need to disable pagination but retain the output:
首先,您需要禁用分页但保留输出:
\pset pager off
Then, use the below query:
然后,使用以下查询:
SELECT * FROM "default_msg_details";