Change unit of idle_replication_slot_timeout to seconds.
authorFujii Masao <[email protected]>
Thu, 10 Jul 2025 23:39:24 +0000 (08:39 +0900)
committerFujii Masao <[email protected]>
Thu, 10 Jul 2025 23:42:16 +0000 (08:42 +0900)
commit37c76aeb9ae30f3fee6ee86f54344670c7099d9c
tree88e58d4c1bdf646edb5f9f6eb56ffa8727a9b01a
parent39f01083facd0ddc0040662a71159e9987813c2c
Change unit of idle_replication_slot_timeout to seconds.

Previously, the idle_replication_slot_timeout parameter used minutes
as its unit, based on the assumption that values would typically exceed
one minute in production environments. However, this caused unexpected
behavior: specifying a value below 30 seconds would round down to 0,
effectively disabling the timeout. This could be surprising to users.

To allow finer-grained control and avoid such confusion, this commit changes
the unit of idle_replication_slot_timeout to seconds. Larger values can
still be specified easily using standard time suffixes, for example,
'24h' for 24 hours.

Back-patch to v18 where idle_replication_slot_timeout was added.

Reported-by: Gunnar Morling <[email protected]>
Author: Fujii Masao <[email protected]>
Reviewed-by: Laurenz Albe <[email protected]>
Reviewed-by: David G. Johnston <[email protected]>
Reviewed-by: Amit Kapila <[email protected]>
Reviewed-by: Hayato Kuroda <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CADGJaX_0+FTguWpNSpgVWYQP_7MhoO0D8=cp4XozSQgaZ40Odw@mail.gmail.com
Backpatch-through: 18
doc/src/sgml/config.sgml
src/backend/replication/slot.c
src/backend/utils/misc/guc_tables.c
src/backend/utils/misc/postgresql.conf.sample
src/include/replication/slot.h