In psql
, with \x
toggled to expanded output mode, I get these very long wrapped dashed lines for record separa开发者_开发问答tors when there is a field with a long string value in one of the selected records. They look like
-[ RECORD 2 ]----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- (is much longer)
Is there any way to suppress or shorten these lines? I'm on PostgreSQL 8.4
Try \t:
test=# select * from test limit 1;
-[ RECORD 1 ]-------------------
id | 1
name | foo
test=# \t
Showing only tuples.
test=# select * from test limit 1;
id | 1
name | foo
Docs.
Also try:
test=# \pset border 0
Border style is 0.
backend=# select * from test limit 2;
id 1
name foo
id 2
name bar
I had the same issue, using these two psql command line flags solved the issue for me:
\x
(good for records with lots of columns)\pset format wrapped
(wraps the postgres output to your terminal width)
I got the response from this dba stackexchange article
I had this issue and just learned about https://www.pgcli.com/, and it fixes this issue by default, and has a host of other features.
精彩评论