psql

Posted on:

This is the setting for psql, a client tool for PostgreSQL.

psql

This is the recommended setting for PSQL_PAGER. Header 1 is specified(-H1),"|" is used to separate columns(-d "|"), and column mode(-C) is set. If it fits on the screen, exit the pager(-F). It is also recommended to change the color of the columns(--column-rainbow).

PSQL_PAGER 'ov -F -C -d "|" -H1 --column-rainbow'

The following sets the header style of config.yaml.

StyleHeader:
  Background: "#23274f"
  Bold: true
StyleColumnHighlight:
  Foreground: "lightcyan"
  Reverse: true
StyleAlternate:
  Background: "#2a2a2a"

psql psql

watch(PostgreSQL 15)

A pager is available for WATCH from PostgreSQL version 15. This is the recommended value for PSQL_WATCH_PAGER. Continues to display the last section separated by blank lines.

PSQL_WATCH_PAGER 'ov --follow-section --section-delimiter "^$"'

watch watch

expanded output (\x)

Even when displaying in the extended output (\x), if the record delimiter is treated as a section delimiter, the display when moved will be easier to see.

PAGER='ov -F --section-delimiter "^-"'

\\x \\x

You can also display expanded output (\x) with \watch.

watch2 watch2

unaligned (\a)

Even in unaligned display, it is displayed comfortably by using column highlighting.

The PAGER specification does not change with the following.

PSQL_PAGER='ov -F -C -d "|" -H1'.

\\a \\a