patternsqlMajor
Queries show data but not column names
Viewed 0 times
showcolumnbutnamesqueriesdatanot
Problem
I'm getting through the postgresql tutorial, I've created my db, 2 tables, weather and cities and added a few lines of data.
When I query my db with this sql statement for example:
I should get this:
but I get this:
I'm missing the column names for all queries. Why wouldn't psql show the column names? Do I have something to configure or is this some kind of bug?
When I query my db with this sql statement for example:
SELECT city, temp_lo, temp_hi, prcp, date FROM weather;I should get this:
city | temp_lo | temp_hi | prcp | date
--------------+---------+---------+------+------------
San Francisco | 46 | 50 | 0.25 | 1994-11-27
San Francisco | 43 | 57 | 0 | 1994-11-29
Hayward | 37 | 54 | | 1994-11-29
(3 rows)but I get this:
San Francisco | 46 | 50 | 0.25 | 1994-11-27
San Francisco | 43 | 57 | 0 | 1994-11-29
Hayward | 37 | 54 | | 1994-11-29I'm missing the column names for all queries. Why wouldn't psql show the column names? Do I have something to configure or is this some kind of bug?
Solution
From the manual:
Toggles the display of output column name headings and row count footer. This command is equivalent to
\t Toggles the display of output column name headings and row count footer. This command is equivalent to
\pset tuples_only and is provided for convenience.Context
StackExchange Database Administrators Q#126506, answer score: 25
Revisions (0)
No revisions yet.