Incomplete description for \t in psql documentation - should mention caption - Mailing list pgsql-hackers

From David G. Johnston
Subject Incomplete description for \t in psql documentation - should mention caption
Date
Msg-id CAKFQuwanqNCLuw7e4BzBVvaVRnyhOP3_0vtTQ0UZvDzRw_9FGg@mail.gmail.com
Whole thread Raw
List pgsql-hackers

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

Experience says that a table caption (i.e., \C) is also suppressed when the option is used.

The documentation should be changed though I'd argue that there is some merit for still showing the caption.

The exact combination I wanted to try and make work was:
\C 'Table Caption'
\x \t
SELECT * FROM tbl LIMIT 1

The desired output would have been:

Table Caption
col1   | 1
col2   | 2
col3   | 3

This is also a bit mis-leading: the \t suppresses column name headings - unless viewed in expanded mode...in which case it suppresses the "ROW#" block heading but leave the column name headings (which just happen to be placed in rows) in place.  This is indeed the desired behavior it just isn't precisely documented.

So:

\t
Toggles display of the row count footer.  In normal mode also suppresses the column name headings.  In expanded mode suppresses the Record# block header instead.  Also suppresses any caption that is set for the table.

I'm not sure how willing someone is to work these mechanics out - or the desire to make them conditional on expanded versus table mode.  My immediate needs can be readily solved by adding an additional column to my output so that "type | Record Type" is the first column of the expanded output.  Or just live with the redundant "-[ RECORD 1 ]---------" header.

David J.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: VS 2015 support in src/tools/msvc
Next
From: Robert Haas
Date:
Subject: Re: max_parallel_degree > 0 for 9.6 beta