Re: psql format output

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Florian Koch <florian(dot)murat(dot)koch(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: psql format output
Date: 2021-12-20 14:44:32
Message-ID: CA+TgmoaLTk=ies7vDponn2LZo2VrY_10r8E-UCfWih2y9wjDTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 17, 2021 at 5:08 AM Peter Eisentraut
<peter(dot)eisentraut(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-12-20 14:49:09 Re: sqlsmith: ERROR: XX000: bogus varno: 2
Previous Message Peter Eisentraut 2021-12-20 14:31:11 Re: sequences vs. synchronous replication