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

From Laurenz Albe
Subject Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)
Date
Msg-id 4adb425afa58e1a94e8674574351ff0fe1950bb1.camel@cybertec.at
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>)
List 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




pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: row filtering for logical replication
Next
From: Bharath Rupireddy
Date:
Subject: Re: CREATE COLLATION - check for duplicate options and error out if found one