]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Revert "Rename routines for write/read of pgstats file"
authorMichael Paquier <michael@paquier.xyz>
Tue, 14 Jul 2026 23:05:08 +0000 (08:05 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 14 Jul 2026 23:05:08 +0000 (08:05 +0900)
commitb464e498cebe34da006575672caeabced1718927
tree9bb160dc6a96718fba58c53d02d083cdc8ffd3c1
parent2349b106b6661c084dc1171654146c730ecb048f
Revert "Rename routines for write/read of pgstats file"

This reverts commit ed823da1289, that has made pgstat_write_chunk() and
pgstat_read_chunk() available for public use.  These routines do not
have a symmetric API definition across reads and writes, with the write
part returning a void status, deferring an error detection once all the
stats entries have been processed with an ferror(), and the read part
returning a boolean status.

These routines are just tiny wrappers around fread() and fwrite(), and
extensions can just define they own routines instead of relying on the
same facilities as the core pgstat.c.  This commit removes their
declaration from the public headers, to reduce the confusion.
test_custom_stats is updated to use its own read/write routines.
Perhaps something better could be designed in the future; trying to do
so for v19 is not feasable during beta.

Reported-by: Peter Eisentraut <peter@eisentraut.org>
Author: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/a4a8e9af-3eaf-4bbf-9b21-21620f3fc434@eisentraut.org
Backpatch-through: 19
src/backend/utils/activity/pgstat.c
src/include/utils/pgstat_internal.h
src/test/modules/test_custom_stats/test_custom_var_stats.c