Add mem_exceeded_count column to pg_stat_replication_slots.
authorMasahiko Sawada <msawada@postgresql.org>
Wed, 8 Oct 2025 17:05:04 +0000 (10:05 -0700)
committerMasahiko Sawada <msawada@postgresql.org>
Wed, 8 Oct 2025 17:05:04 +0000 (10:05 -0700)
commitd3b6183dd988928dd369b4b7d641917e77f1ae4e
tree021b43628b3e43871984121ba75c4a41b8992720
parent14ad0d7bf2b8d5f26061df7cbdf18cfffcdcb225
Add mem_exceeded_count column to pg_stat_replication_slots.

This commit introduces a new column mem_exceeded_count to the
pg_stat_replication_slots view. This counter tracks how often the
memory used by logical decoding exceeds the logical_decoding_work_mem
limit. The new statistic helps users determine whether exceeding the
logical_decoding_work_mem limit is a rare occurrences or a frequent
issue, information that wasn't available through existing statistics.

Bumps catversion.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/978D21E8-9D3B-40EA-A4B1-F87BABE7868C@yesql.se
13 files changed:
contrib/test_decoding/expected/stats.out
contrib/test_decoding/sql/stats.sql
doc/src/sgml/monitoring.sgml
src/backend/catalog/system_views.sql
src/backend/replication/logical/logical.c
src/backend/replication/logical/reorderbuffer.c
src/backend/utils/activity/pgstat_replslot.c
src/backend/utils/adt/pgstatfuncs.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/include/pgstat.h
src/include/replication/reorderbuffer.h
src/test/regress/expected/rules.out