Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs) - Mailing list pgsql-hackers

From David Christensen
Subject Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)
Date
Msg-id CAHM0NXgDjp6f-4A5PwKnmmQgVY3-p-yRA5w0c8B0To1rUV6scw@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)
List pgsql-hackers
Hi Justin,

Thanks for the patch and the work on it.  In reviewing the basic
feature, I think this is something that has utility and is worthwhile
at the high level.

A few more specific notes:

The pg_namespace_size() function can stand on its own, and probably
has some utility for the released Postgres versions.

I do think the psql implementation for the \dn+ or \dA+ commands
shouldn't need to use this same function; it's a straightforward
expansion of the SQL query that can be run in a way that will be
backwards-compatible with any connected postgres version, so no reason
to exclude this information for this cases.  (This may have been in an
earlier revision of the patchset; I didn't check everything.)

I think the \dX++ command versions add code complexity without a real
need for it.  We have precedence with \l(+) to show permissions on the
basic display and size on the extended display, and I think this is
sufficient in this case here.  While moving the permissions to \dn is
a behavior change, it's adding information, not taking it away, and as
an interactive command it is unlikely to introduce significant
breakage in any scripting scenario.

(In reviewing the patch we've also seen a bit of odd behavior/possible
bug with the existing extended + commands, which introducing
significant ++ overloading might be confusing, but not the
fault/concern of this patch.)

Quickie summary:

0001-Add-pg_am_size-pg_namespace_size.patch
- fine, but needs rebase to work
0002-psql-add-convenience-commands-dA-and-dn.patch
- split into just + variant; remove \l++
- make the \dn show permission and \dn+ show size
0003-f-convert-the-other-verbose-to-int-too.patch
- unneeded
0004-Move-the-double-plus-Size-columns-to-the-right.patch
- unneeded

Docs on the first patch seemed fine; I do think we'll need docs
changes for the psql changes.

Best,

David



pgsql-hackers by date:

Previous
From: Alena Rybakina
Date:
Subject: Vacuum statistics
Next
From: Alena Rybakina
Date:
Subject: Re: Vacuum statistics