Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Ian Lawrence Barwick <barwick@gmail.com>, pgsql-hackers@postgresql.org, gilles@darold.net
Date: 2021-07-16T09:10:33Z
Lists: pgsql-hackers
On Thu, 2021-07-15 at 20:16 -0500, Justin Pryzby wrote: > On Wed, Jul 14, 2021 at 07:42:33AM +0200, Laurenz Albe wrote: > > Besides, schemas are not physical, but logical containers. So I see a point in > > measuring the storage used in a certain tablespace, but not so much by all objects > > in a certain schema. It might be useful for accounting purposes, though. > > > > But I don't expect it to be in frequent enough demand to add a psql command. > > But for "physical" storage it's also possible to get the size from the OS, much > more efficiently, using /bin/df or zfs list (assuming nothing else is using > those filesystems). The pg_*_size functions are inefficient, but psql \db+ and > \l+ already call them anyway. Hm, yes, the fact that \l+ does something similar detracts from my argument. It seems somewhat inconsistent to have the size in \l+, but not in \dn+. Still, there is a difference: I never need \l+, because \l already shows the permissions on the database, but I often need \dn+ to see the permissions on schemas. And I don't want to measure the size when I do that. The problem is that our backslash commands are not totally consistent in that respect, and we can hardly fix that. Yours, Laurenz Albe