Re: Generate pg_stat_get_* functions with Macros

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-07T00:16:14Z
Lists: pgsql-hackers
On Tue, Dec 06, 2022 at 05:28:47AM +0100, Drouvot, Bertrand wrote:
> Fields renaming was mandatory in the previous ones as there was
> already a mix of with/without "n_" in the existing fields names.
> 
> That said, I think it's better to rename the fields as you did (to
> be "consistent" on the naming between relation/db stats), so the
> patch LGTM.

Yeah, PgStat_StatDBEntry is the last one using this style, so I have
kept my change with the variables renamed rather than painting more
CppConcat()s.  The functions are still named the same as the original
ones.
--
Michael

Commits

  1. Fix macro definitions in pgstatfuncs.c

  2. Generate pg_stat_get*() functions for databases using macros