How to set default display mode in psql

后端 未结 4 802
长发绾君心
长发绾君心 2021-02-05 04:27

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

4条回答
  •  一向
    一向 (楼主)
    2021-02-05 04:31

    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.

提交回复
热议问题