Re: Add pg_stat_kind_info system view

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tristan Partin <tristan(at)partin(dot)io>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pg_stat_kind_info system view
Date: 2026-06-30 07:59:04
Message-ID: akN3SDTpxbkrAeNb@bdtpg
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Jun 30, 2026 at 03:42:40PM +0900, Michael Paquier wrote:
> On Wed, Jun 24, 2026 at 05:31:12AM +0000, Bertrand Drouvot wrote:
> > But header in pgstat_internal.h mentions:
> >
> > "
> > * Definitions for the PostgreSQL cumulative statistics system that should
> > * only be needed by files implementing statistics support (rather than ones
> > * reporting / querying stats).
> >
> > "
> >
> > So it looks like that we are breaking this convention here. Maybe add helper
> > function(s)?
>
> Yeah. Pulling pgstat_internal.h in pgstatfuncs.c is not great. The
> code acts as a barrier as the internal part and the fields data
> retrieved by the functions. A couple of alternatives I can think of:
> - Put this new function in a new file under activity, named blankly
> pgstat_kind.c.
> - Move the necessary stuff out of pgstat_internal.h into a new header,
> or just pgstat_kind.h with a !FRONTEND block.
> - Use a new wrapper function that copies the data we need into an
> intermediate structure. This is just a new pgstat_get_kind_info().
>
> Among these two, putting pg_stat_get_kind_info() into a new file feels
> much better than splitting the contents of pgstat_internal.h, which is
> kind of the central in-core shmem-side facility.

I do agree. That said, creating a new file only for one function looks a bit
weird (but I can not think of a better option though).

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-06-30 08:00:05 Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows
Previous Message Ayush Tiwari 2026-06-30 07:51:40 Re: Fix RLS checks for UPDATE/DELETE FOR PORTION OF leftover rows