Re: Add pg_stat_kind_info system view

Sami Imseih <samimseih@gmail.com>

From: Sami Imseih <samimseih@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Tristan Partin <tristan@partin.io>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-07-01T04:17:29Z
Lists: pgsql-hackers
> > > I think this should be 0 for all kinds by default. Only ever > 0 for
> > > variable-numbered
> > > kinds with entry tracking enabled. No NULLs. The fields should be called
> > > "entry_count" instead of "count". We should update the documentation to
> > > reflect that as well. That seems easier to query than having mixed NULLs and
> > > numbers.
> >
> > IMO, in this case, NULL should be a synonym of "I don't know", which
> > is what entry_count set to false means.  0 means "I know, there is no
> > data".  I'd be OK with dropping the part about fixed-sized stats where
> > we enforce 1, and use NULL instead, though.
>
> +1, that's also my opinion [1].
>
> [1]: https://postgr.es/m/ajtroNXfBS/ldtNZ%40bdtpg

I'm ok with that if others feel this is better.

--
Sami



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add system view pg_stat_kind_info

  2. Introduce pluggable APIs for Cumulative Statistics