PostgreSql command to see the table data

狂风中的少年 提交于 2019-12-03 17:41:45

问题


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.

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.

Please tell me if any command or why this select its not displaying anything.


回答1:


Because you need to terminate your statement with a ;




回答2:


Try 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.




回答3:


Firstly, you need to disable pagination but retain the output:

\pset pager off

Then, use the below query:

SELECT * FROM "default_msg_details";


来源:https://stackoverflow.com/questions/9178406/postgresql-command-to-see-the-table-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!