Almost every psql query comes out an illegible mess if not preceded by display configuration commands such as \x auto
. Typing this manually for each psql instance is annoying.
Expanded display is used automatically.
Is there any way to configure a better default display? Or perhaps the answer is to use a more advanced interactive terminal?
postgres=# means you could start a new command. postgres-# means this is the continuation of the active command.
within the psql shell: Also to note: the psql command line option -P expanded=auto or --pset expanded=auto is the same as using \x auto from within.
The meta-command for exiting psql is \q .
psql is a terminal-based front-end to PostgreSQL. It enables you to type in queries interactively, issue them to PostgreSQL, and see the query results.
Use .psqlrc
to set defaults.
For the specific case of \x
, newer psql
versions (9.3, I think, but it might just be the 9.4 pre-release) can automatically switch to expanded output mode when the rows are too wide to fit on a line. From \?
:
\x [on|off|auto] toggle expanded output (currently off)
So I suggest putting \x auto
in your .psqlrc
, rather than forcing it to on
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With