PostgreSql command to see the table data

2020-06-03 04:10发布

问题:

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";