Re: Fwd: Another little thing about psql wrapped expanded output

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: Another little thing about psql wrapped expanded output
Date: 2015-12-02 22:24:37
Message-ID: 28797.1449095077@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> On Wed, Dec 2, 2015 at 12:37 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>> If you're fixing the dashed-line code, is there a way to say that we
>> never have more than a reasonable number of dashes (ideally, the width
>> of the terminal) no matter how wide the data is? Having 4000 dashes
>> because of large text on one row is kinda painful, and not at all useful.

> If you use the default format (\pset format aligned) in expanded mode, then
> I agree with you we shouldn't print a half screen full of dashes to
> separate every tuple.

Don't think I agree. Suppose that you have a wider-than-screen table
and you use a pager to scroll left and right in that. If we shorten the
dashed lines, then once you scroll to the right of wherever they stop,
you lose that visual cue separating the rows. This matters a lot if
only a few of the column values are very wide: everywhere else, there's
gonna be lots of whitespace.

In the situation you are describing, you've already pretty much lost
user-friendliness of the display, and the only way to get it back is
to use a suitable pager (or make the window bigger, but that only goes
so far). So I don't think we should optimize the non-pager case at
the expense of the pager case.

It's possible that it'd be worth the trouble to give psql two operating
modes, one for pagers with left-right scroll ability and one for those
without. But that would be a good deal more work than what I propose
to do at the moment.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-12-02 23:38:15 Re: pgsql: Refactor Perl test code
Previous Message Jim Nasby 2015-12-02 22:11:10 Re: proposal: function parse_ident