\pset NAME [ VALUE ]
\pset NAME [ VALUE ]
sets options affecting the output of query result tables. NAME describes which option to set, as illustrated in the following table. The parameters of VALUE depend thereon.
It is an error to call \pset
without arguments.
Adjustable printing options are:
format |
Sets the output format to one of "Unaligned" writes all columns of a row on a line, separated by the currently active field separator. This is intended to create output that might be intended to be read in by other programs (tab- separated, comma-separated). "Aligned" mode is the standard, human-readable, nicely formatted text output that is default. The "HTML" and "LaTeX" modes put out tables that are intended to be included in documents using the respective mark-up language. They are not complete documents! (This might not be so dramatic in HTML, but in LaTeX you must have a complete document wrapper.) |
border |
The second argument must be a number. In general, the higher the number the more borders and lines the tables have, but this depends on the particular format. In HTML mode, this translates directly into the |
expanded |
Toggles between regular and expanded format. When expanded format is enabled, all output has two columns with the column name on the left and the data on the right. This mode is useful if the data wouldn't fit on the screen in the normal "horizontal" mode. Expanded mode is supported by all four output formats.
|
fieldsep |
Specifies the field separator to be used in unaligned output mode. That way one can create, for example, tab- or comma-separated output, which other programs might prefer. To set a tab as field separator, type |
footer |
Toggles the display of the default footer |
null |
The second argument is a string that is printed whenever a column is null. The default is not to print anything, which can easily be mistaken for, say, an empty string. Thus, one might choose to write |
recordsep |
Specifies the record (line) separator to use in unaligned output mode. The default is a newline character. |
trailingrecordsep |
Toggles on or off the trailing record separator to use in unaligned output mode. |
tuples_only (or t) |
Toggles between tuples only and full display. Full display might show extra information such as column headers, titles, and various footers. In tuples only mode, only actual table data is shown. |
title [ text ] |
Sets the table title for any subsequently printed tables. This can be used to give your output descriptive tags. If no argument is given, the title is unset. |
tableattr (or T)[ text ] |
Allows you to specify any attributes to be placed inside the HTML |
pager |
Controls use of a pager for query and vsql help output. If the environment variable When the pager is off, the pager is not used. When the pager is on, the pager is used only when appropriate; that is, the output is to a terminal and does not fit on the screen. (vsql does not do a perfect job of estimating when to use the pager.) |
See illustrations on how these different formats look in the Examples section.