Re: Add pg_stat_recovery system view

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Xuneng Zhou <xunengzhou@gmail.com>
Cc: yangyz <1197620467@qq.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-06T06:30:17Z
Lists: pgsql-hackers
On Fri, Mar 06, 2026 at 02:21:49PM +0800, Xuneng Zhou wrote:
> For a single-row function with ~8–10 columns, saving one palloc is a
> micro-optimization, not a major performance issue. I am not that sure of
> the benefit it brings, still preparing a small patch to turn the palloc
> into a fixed stack array.

Yes, I don't see a point in changing anything here.
--
Michael

Commits

  1. Fix order of columns in pg_stat_recovery

  2. Add system view pg_stat_recovery

  3. Refactor code retrieving string for RecoveryPauseState

  4. Move definition of XLogRecoveryCtlData to xlogrecovery.h