Description
ThePretty format outputs data as Unicode-art tables,
using ANSI-escape sequences for displaying colors in the terminal.
A full grid of the table is drawn, and each row occupies two lines in the terminal.
Each result block is output as a separate table.
This is necessary so that blocks can be output without buffering results (buffering would be necessary to pre-calculate the visible width of all the values).
NULL is output as ᴺᵁᴸᴸ.
Example usage
Example (shown for thePrettyCompact format):
Query
Response
Pretty formats. Instead, non-printable control characters (C0 controls 0x00-0x1F and DEL 0x7F) in the values and in the column names are displayed as the corresponding Unicode “Control Pictures” (U+2400-U+2421) by default, so that they stay visible and do not deform the table. For example, a NUL is shown as ␀:
Query
Response
TAB, the line feed and ESC are exceptions: they are always printed as is, because a terminal interprets them rather than swallowing them - a tab advances to the next tab stop, and an ANSI escape sequence is what lets the data carry a visualization. A line feed keeps breaking the line too: inside a table cell when output_format_pretty_multiline_fields is enabled, and as is otherwise. A column name is the exception to that exception: the header and the footer are a single line, so a line feed in a name is replaced like any other control character.
To print control characters verbatim instead, disable output_format_pretty_display_control_characters:
Query
NUL byte instead. A terminal swallows it, so the character
is invisible and the row is one position wider than the border that was measured for it - the
deformed table that displaying the Control Picture avoids.
To avoid dumping too much data to the terminal, only the first 10,000 rows are printed.
If the number of rows is greater than or equal to 10,000, the message “Showed first 10 000” is printed.
This format is only appropriate for outputting a query result, but not for parsing data.
WITH TOTALS) and extremes (when ‘extremes’ is set to 1).
In these cases, total values and extreme values are output after the main data, in separate tables.
This is shown in the following example which uses the PrettyCompact format:
Query
Response
Format settings
The following settings are common to allPretty formats: