Generate pg_stat_get_* functions with Macros - Mailing list pgsql-hackers

From Drouvot, Bertrand
Subject Generate pg_stat_get_* functions with Macros
Date
Msg-id d547a9bc-76c2-f875-df74-3ad6fd9d6236@gmail.com
Whole thread Raw
Responses Re: Generate pg_stat_get_* functions with Macros
List pgsql-hackers
Hi hackers,

Please find attached a patch proposal to $SUBJECT.

The idea has been proposed by Andres in [1] and can be seen as preparatory work for [1].

The patch introduces 2 new Macros, PGSTAT_DEFINE_REL_INT64_FIELD_ACCESSOR and PGSTAT_DEFINE_REL_TSTZ_FIELD_ACCESSOR.

For some functions (namely pg_stat_get_ins_since_vacuum(), pg_stat_get_dead_tuples(), pg_stat_get_mod_since_analyze(),
pg_stat_get_live_tuples(), pg_stat_get_last_autovacuum_time(), pg_stat_get_autovacuum_count(),
pg_stat_get_last_vacuum_time(),
pg_stat_get_last_autoanalyze_time(), pg_stat_get_autoanalyze_count() and pg_stat_get_last_analyze_time()), I had to
choosebetween renaming the function and the counter.
 

I took the later option to avoid changing the linked views, tests....

This patch is also a step forward to "cleaning" the metrics/fields/functions naming (means having them match).

[1]: https://www.postgresql.org/message-id/flat/f572abe7-a1bb-e13b-48c7-2ca150546822@gmail.com

Looking forward to your feedback,

Regards,

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

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: wake up logical workers after ALTER SUBSCRIPTION
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: Split index and table statistics into different types of stats