On 2019-Apr-07, Pavel Stehule wrote:
> ne 7. 4. 2019 v 20:27 odesílatel Alvaro Herrera <alvherre@2ndquadrant.com>
> napsal:
> > In order for this to display sanely, I added the "Parent name" column if
> > either the "n" flag is shown or a pattern is given (previously it only
> > appeared in the former case).
>
> I am thinking about it and original behave and this new behave should be
> expected (and unexpected too). We can go this way - I have not
> counter-arguments, but yes, it is more consistent with some other commands,
> pattern disables some other constraints.
>
> It should be documented - Using any pattern in this case forces 'n' flag.
Added to the docs, and pushed.
I couldn't resist tweaking the ORDER BY clause, too. I think listing
all tables first, followed by all indexes, and sorting by parent in each
category, is much easier to read. (Maybe this can use additional
tweaking, but it's a minor thing anyway -- for example putting together
all indexes that correspond to some particular table?)
I noticed that \d never seems to use pg_total_relation_size, so toast
size is never shown. I did likewise here too and used pg_table_size
everywhere. I'm not 100% sure this is the most convenient thing. Maybe
we need yet another column, and/or yet another flag ...?
Also, I think the new \dP should gain a new flag (maybe "l") to make it
list leaf tables/indexes too with their local sizes, and remove those
from the standard \d listing.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services