HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMajor

Queries show data but not column names

Submitted by: @import:stackexchange-dba··
0
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:

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-29


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?

Solution

From the manual:


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