agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Revert "Rename routines for write/read of pgstats file"
2+ messages / 1 participants
[nested] [flat]

* pgsql: Revert "Rename routines for write/read of pgstats file"
@ 2026-07-14 23:05  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2026-07-14 23:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/381b3cfe2be02aa114ef7a28c4ec24feaf377c63

Modified Files
--------------
src/backend/utils/activity/pgstat.c                | 55 ++++++++++++----------
src/include/utils/pgstat_internal.h                |  5 --
.../test_custom_stats/test_custom_var_stats.c      | 28 ++++++-----
3 files changed, 46 insertions(+), 42 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Revert "Rename routines for write/read of pgstats file"
@ 2026-07-14 23:05  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2026-07-14 23:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b464e498cebe34da006575672caeabced1718927

Modified Files
--------------
src/backend/utils/activity/pgstat.c                | 55 ++++++++++++----------
src/include/utils/pgstat_internal.h                |  5 --
.../test_custom_stats/test_custom_var_stats.c      | 28 ++++++-----
3 files changed, 46 insertions(+), 42 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-07-14 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14 23:05 pgsql: Revert "Rename routines for write/read of pgstats file" Michael Paquier <michael@paquier.xyz>
2026-07-14 23:05 pgsql: Revert "Rename routines for write/read of pgstats file" Michael Paquier <michael@paquier.xyz>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox