Re: Add a permission check to pg_stat_get_backend_subxact()

From: solai v <solai(dot)cdac(at)gmail(dot)com>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add a permission check to pg_stat_get_backend_subxact()
Date: 2026-09-25 07:06:18
Message-ID: CAF0whudLDgQDZq61+rLK4CP229S2kXZqHZ01oe5663m4gpJTVw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

On Fri, Sep 25, 2026 at 12:04 PM shihao zhong <zhong950419(at)gmail(dot)com> wrote:
>
> Hi Michael,
>
> > Let me doubt you here. For one, it makes the API contract of
> > ProcNumberGetTransactionIds() much harder to think about.
>
> Fair enough, let's drop 0002. Attached is v12, which is v11-0001 alone
> and unchanged.
>

Thank you for the updated v12 patch. I tested the patch, and the
regression suite completed successfully. I went through the permission
checks for the per-backend statistics functions. The added regression
tests behaved as expected for the backend owner, an unrelated role,
and a role with pg_read_all_stats privileges. I reviewed the userid
handling in the backend statistics entry as well, including how the
owner information is preserved when the statistics are reset. I also
checked and verified the added comment around ProcNumber reuse and
cached statistics. I went through the documentation and verified the
changes done to pg_stat_get_backend_subxact(),
pg_stat_get_backend_io(), pg_stat_get_backend_wal(), and
pg_stat_get_backend_lock(). All the changes look correct to me and I
did not find any other issues based on my testing and review.

Regards.
Solai

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2026-09-25 07:08:31 Re: RFC: Logging plan of the running query
Previous Message Hannu Krosing 2026-09-25 06:49:52 Re: Direct TOAST v2, faster, smaller and no migration needed