Shell (psql+)

Output & formatting

psql+ is built for reading real result sets — wide tables, long rows, and queries you want to time — without the output turning into a tangle of wrapped lines.

Paging that respects wide tables

When a result is wider than your terminal, standard tools wrap each row, which mangles the columns. psql+ pages results with horizontal scrolling instead: use the arrow keys to move left and right across columns, and the header stays aligned with the data underneath it.

-- Standard psql wraps a wide row into an unreadable block:
 id | customer_name | email            | status | total_cents | crea
----+---------------+------------------+--------+-------------+-----
  1 | Ada Lovelace  | ada@example.com  | paid   |       12900 | 2026
-05-01 09:14:22+00
-- psql+ keeps columns aligned and lets you scroll → for the rest:
 id | customer_name | email           | status | total_cents | created_at
----+---------------+-----------------+--------+-------------+------------------
  1 | Ada Lovelace  | ada@example.com | paid   |       12900 | 2026-05-01 09:14…
        ← / → to scroll columns · q to exit

Long individual values are smart-truncated with an ellipsis () so a single oversized cell doesn't blow out the whole row; scroll to it to see the full text.

Expanded display: \x

For rows with many columns, pivot the layout so each field sits on its own line. Toggle it with \x:

=# \x
Expanded display is on.
=# SELECT * FROM orders WHERE id = 1;

-[ RECORD 1 ]-+-------------------------
id            | 1
customer_name | Ada Lovelace
email         | ada@example.com
status        | paid
total_cents   | 12900
created_at    | 2026-05-01 09:14:22+00

Run \x again to turn it off, or \x auto to let the shell switch to expanded layout only when a row is too wide to fit.

Per-statement timing: \timing

Toggle \timing to print how long each statement took:

=# \timing
Timing is on.
=# SELECT count(*) FROM orders;
 count
-------
 48213
Time: 12.480 ms

Null display and alignment

  • Nulls print as an empty cell by default. Set a visible marker so you can tell NULL apart from an empty string: \pset null '∅'.
  • Aligned (the default) draws the bordered, column-aligned table you see above — best for reading.
  • Unaligned (\a) emits raw, delimiter-separated rows — best for piping into a file or another tool. Pair it with \pset fieldsep ',' for CSV-style output.

All of these are session toggles; set the defaults you prefer in ~/.config/rillence/config.toml.