Re: Allow pg_read_all_stats to see database size in \l+

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Subject: Re: Allow pg_read_all_stats to see database size in \l+
Date: 2026-07-22 12:34:30
Message-ID: CAHGQGwEm55gLocu=ev7BM_ZbMWdykUvMPW2q72Lp84PyKkaNyg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 22, 2026 at 8:26 PM Christoph Berg <myon(at)debian(dot)org> wrote:
>
> psql \l+ didn't consider pg_read_all_stats when determining whether
> the user was allowed to see the database size.

+1 to this fix.

> Split off from the "Available disk space per tablespace" patch since
> it's really an independent fix. Thanks Zsolt for pointing that out.
>
> This might be considered for backpatching.

The pg_read_all_stats check should be fine in master, since psql there
no longer supports pre-v10 servers, which don't have that role. But,
if this is backpatched, psql still needs to work with pre-v10 servers,
so we'll probably need a server version check (e.g., pset.sversion >= 100000)
before checking for pg_read_all_stats, at least in the older stable branches.

Also, should the following description of the \l+ meta-command in
the psql docs be updated?

(Size information is only available for databases that the current
user can connect to.)

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-07-22 12:59:25 Incorrect check in 037_except.pl?
Previous Message Peter Eisentraut 2026-07-22 12:31:49 Re: convert various variables to atomics