Re: \du quite ugly in 8.4

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: \du quite ugly in 8.4
Date: 2009-10-21 12:28:01
Message-ID: 1256128081.7960.6.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Could someone clarify why this (from PG 8.4)

# \du
List of roles
Role name | Attributes | Member of
---------------+-------------+------------
admin | Create role | {}
: Create DB
postgres | Superuser | {}
: Create role
: Create DB
someotheruser | | {}
someuser | | {}

is an improvement over this (from PG 8.3)

# \du
List of roles
Role name | Superuser | Create role | Create DB | Connections |
---------------+-----------+-------------+-----------+-------------+------------
admin | no | yes | yes | no limit | {}
postgres | yes | yes | yes | no limit | {}
someotheruser | no | no | no | no limit | {}
someuser | no | no | no | no limit | {}
(4 rows)

The way I see it, a perfectly clear, complete, and legible table has
been turned into a denormalized, unreadable, and ugly pile of ASCII
salad that moreover wastes valuable vertical screen space instead of
using the abundant horizontal screen space.


From: Thom Brown <thombrown(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: \du quite ugly in 8.4
Date: 2009-10-21 12:38:09
Message-ID: bddc86150910210538o544cda02u9f00dad1d74c2dd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2009/10/21 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> Could someone clarify why this (from PG 8.4)
>
> # \du
>              List of roles
>   Role name   | Attributes  | Member of
> ---------------+-------------+------------
>  admin         | Create role | {}
>               : Create DB
>  postgres      | Superuser   | {}
>               : Create role
>               : Create DB
>  someotheruser |             | {}
>  someuser      |             | {}
>
> is an improvement over this (from PG 8.3)
>
> # \du
>                                 List of roles
>   Role name   | Superuser | Create role | Create DB | Connections |
> ---------------+-----------+-------------+-----------+-------------+------------
>  admin         | no        | yes         | yes       | no limit    | {}
>  postgres      | yes       | yes         | yes       | no limit    | {}
>  someotheruser | no        | no          | no        | no limit    | {}
>  someuser      | no        | no          | no        | no limit    | {}
> (4 rows)
>
> The way I see it, a perfectly clear, complete, and legible table has
> been turned into a denormalized, unreadable, and ugly pile of ASCII
> salad that moreover wastes valuable vertical screen space instead of
> using the abundant horizontal screen space.
>

I can see a possible advantage in that there is more room to list the
membership items (although I can't see that being useful most of the
time), and it also provides flexibility by providing an undefined list
of attributes compared to a defined list. For example, the new format
allows the display of "No inheritance", something not shown in the old
format.

However, if that is the limit of how this more flexible approach is
being taken advantage of, I'd tend to agree that the previous format
was fine.

Thom


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: \du quite ugly in 8.4
Date: 2009-10-21 13:28:18
Message-ID: 20091021132818.GA2526@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Could someone clarify why this (from PG 8.4)
>
> # \du
> List of roles
> Role name | Attributes | Member of
> ---------------+-------------+------------
> admin | Create role | {}
> : Create DB
> postgres | Superuser | {}
> : Create role
> : Create DB
> someotheruser | | {}
> someuser | | {}
>
> is an improvement over this (from PG 8.3)

The reason it's an improvement of sorts is that there are now more
possible attributes, and if we had kept adding columns it would have
become wider than 80 columns.

If there's a way to have the attributes as a single line,
comma-separated, but that wraps around when exceeding the terminal
width, I'm all for it. We could also use that logic in a lot more
\-commands, so it'd be worthwhile I think.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: \du quite ugly in 8.4
Date: 2009-10-21 14:54:17
Message-ID: 28002.1256136857@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> The reason it's an improvement of sorts is that there are now more
> possible attributes, and if we had kept adding columns it would have
> become wider than 80 columns.

Yeah, 8.4 has two more possible entries, and adding them as separate
columns would have guaranteed that the display doesn't fit in 80 cols.

> If there's a way to have the attributes as a single line,
> comma-separated, but that wraps around when exceeding the terminal
> width, I'm all for it. We could also use that logic in a lot more
> \-commands, so it'd be worthwhile I think.

The hard part of that is the "wrap" bit. I wonder how badly we need
that part though. If we just made it comma-separated instead of
newline-separated, it would be a trivial code change, and I bet it would
still look okay for the typical case where the user has only a subset of
these properties.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: \du quite ugly in 8.4
Date: 2009-10-31 10:30:56
Message-ID: 1256985056.28195.9.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On ons, 2009-10-21 at 10:28 -0300, Alvaro Herrera wrote:
> Peter Eisentraut wrote:
> > Could someone clarify why this (from PG 8.4)
> >
> > # \du
> > List of roles
> > Role name | Attributes | Member of
> > ---------------+-------------+------------
> > admin | Create role | {}
> > : Create DB
> > postgres | Superuser | {}
> > : Create role
> > : Create DB
> > someotheruser | | {}
> > someuser | | {}
> >
> > is an improvement over this (from PG 8.3)
>
> The reason it's an improvement of sorts is that there are now more
> possible attributes, and if we had kept adding columns it would have
> become wider than 80 columns.

How relevant is that 80 columns? I did a mockup using the old design
with two extra columns added and it fit within 100 columns, which still
leaves plenty of horizontal space on the screen.

As a compromise, we could keep the combined "Attributes" column but
replace the line breaks by commas. This would at least get rid of the
confusing and ugly line breaks in the common cases.

> If there's a way to have the attributes as a single line,
> comma-separated, but that wraps around when exceeding the terminal
> width, I'm all for it. We could also use that logic in a lot more
> \-commands, so it'd be worthwhile I think.

Well, the opposite argument could also be made. When the display gets
too long, switch to a wider format.

The argument could be made, however, that it is more important to keep
the relevant information (the role names) on one screen instead of
trying too hard to fit the less important information (the attributes)
on one screen.


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: \du quite ugly in 8.4
Date: 2009-11-01 17:58:16
Message-ID: 20091101175816.GC4428@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:

> As a compromise, we could keep the combined "Attributes" column but
> replace the line breaks by commas. This would at least get rid of the
> confusing and ugly line breaks in the common cases.

That works for me.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: \du quite ugly in 8.4
Date: 2009-11-01 18:35:11
Message-ID: 37ed240d0911011035j398f3317r76e174f2ded5812b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2009/11/2 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
> Peter Eisentraut wrote:
>> As a compromise, we could keep the combined "Attributes" column but
>> replace the line breaks by commas.  This would at least get rid of the
>> confusing and ugly line breaks in the common cases.
>
> That works for me.

Mmm, perhaps we were a little too hasty about employing the improved
multiline support in psql when we implemented this feature.

I personally don't see what Peter dislikes about the output ... to me
the example he posted is far more readable with linebreaks than it
would be without, but the original thread [1] didn't provoke a lot of
discussion. I think it's likely that a lot of people just plain
missed the thread and are only now seeing the new output as they try
out 8.4. I suppose it's inevitable that some of them won't like it.

Will fewer people take offense if we change it to commas? Perhaps.
It might be worth giving it a try just to see what the reaction is,
but I won't be astonished if we get a similar ratio of people annoyed
by the change regardless of whether we use commas or linebreaks.

Cheers,
BJ

[1] http://archives.postgresql.org/message-id/9543.1203007337@sss.pgh.pa.us