Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSql command to see the table data

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.

like image 758
Amit Singh Tomar Avatar asked Feb 07 '12 14:02

Amit Singh Tomar


3 Answers

Because you need to terminate your statement with a ;

like image 144
Klaus Byskov Pedersen Avatar answered Nov 16 '22 05:11

Klaus Byskov Pedersen


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.

like image 12
Lisa Avatar answered Nov 16 '22 05:11

Lisa


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

\pset pager off

Then, use the below query:

SELECT * FROM "default_msg_details";
like image 1
Sajjad Manal Avatar answered Nov 16 '22 03:11

Sajjad Manal