Re: psql format output - Mailing list pgsql-hackers

From Robert Haas
Subject Re: psql format output
Date
Msg-id CA+TgmoaLTk=ies7vDponn2LZo2VrY_10r8E-UCfWih2y9wjDTA@mail.gmail.com
Whole thread Raw
In response to Re: psql format output  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: psql format output
List pgsql-hackers
On Fri, Dec 17, 2021 at 5:08 AM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
> That's a reasonable idea.  I wonder if it would work in general.  If
> someone had a C function (so no source code) with three arguments, they
> might be annoyed if it now displayed as three lines by default.

The problem I see is that each of those three lines would probably wrap.

For example, consider:

rhaas=# \df+ pg_copy_logical_replication_slot

In an 80-column window, the first non-header line of output looks like this:

 pg_catalog | pg_copy_logical_replication_slot | record           | src_slot_nam

Since we don't even fit the whole parameter name and data type in
there, never mind the rest of the columns, the proposed solution can't
help here. Each of the three output lines are over 300 characters.

When I full-screen my terminal window, it is 254 characters wide. So
if I were working full screen, then this proposal would cause that
output not to wrap when it otherwise would have done so. But if I were
working with a normal size window or even somewhat wider than normal,
it would just give me multiple wrapped lines.

It's hard to make any general judgment about how wide people's
terminal windows are likely to be, but it is my opinion that the root
of the problem is that \df+ just wants to display a whole lot of stuff
- and as hackers add more function properties in the future, they're
likely to get added in here as well. This output format doesn't scale
nicely for that kind of thing, but it's unclear to me what would be
any better.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: sequences vs. synchronous replication
Next
From: Robert Haas
Date:
Subject: Re: sqlsmith: ERROR: XX000: bogus varno: 2