pgsql: Add assertion in pgstat_write_statsfile() about processes allowe - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Add assertion in pgstat_write_statsfile() about processes allowe
Date
Msg-id E1sS9WE-001LHC-Qh@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add assertion in pgstat_write_statsfile() about processes allowed

This routine can currently only be called from the postmaster in
single-user mode or the checkpointer, but there was no sanity check to
make sure that this was always the case.

This has proved to be useful when hacking the zone (at least to me), to
make sure that the write of the pgstats file happens at shutdown, as
wanted by design, in the correct process context.

Discussion: https://postgr.es/m/ZnEiqAITL-VgZDoY@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/734c057a8935fca10ff67173c8b969ef799ea7d2

Modified Files
--------------
src/backend/utils/activity/pgstat.c | 3 +++
1 file changed, 3 insertions(+)


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: pgsql: Fix a typo in logicalrep_write_typ().
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Fix ALTER TABLE DETACH for inconsistent indexes