Home > Software design >  displaying column names instead of data from psql terminal
displaying column names instead of data from psql terminal

Time:05-31

I connect to the remote ubuntu 20.04 computer from the terminal with ssh, connect to the database that I have installed on the postgres user, and I want to see the data in a column with psql commands. I am not displaying the data, but the columns as much as the number of data.

The codes I write:

SELECT 'Name' FROM "Restaurants";

The result:

enter image description here

How can I view the datas?

CodePudding user response:

'Name' is a string constant, identifiers (column names) must be enclosed in double quotes (the same you did with the table name)

SELECT "Name" FROM "Restaurants";

CodePudding user response:

SELECT * FROM Restaurants -> You can view all column

  • Related