Subject: Operational issues when max_replication_slots is exhausted

From: Ahmed Et-tanany <[email-masked]>
Date: Mon, 15 Dec 2025 12:58:43 +0100

Hello PostgreSQL community,

We have an issue related to `max_replication_slots` that I am not sure
would qualify as a bug,
so I thought I would ask here first.

Our problem is that when our customers use up all available replication
slots for logical replication,
our database management tasks that also require a slot fail (for example,
creating the required
replication slot for a new physical standby). Since increasing
`max_replication_slots` requires
a restart, we would like to avoid that if possible.

One idea we have considered is patching PostgreSQL to add a new GUC
parameter that would allow
a superuser to reserve a certain number of replication slots usable only
for management tasks.

Is this a known issue that might be addressed in PostgreSQL at some point?
If not,
what would be a good way to solve this problem?

Thanks in advance.

Best regards,

-- 
Ahmed Et-tanany
Aiven: https://aiven.io/

---

From: Laurenz Albe <[email-masked]>
Date: Mon, 15 Dec 2025 16:17:52 +0100

On Mon, 2025-12-15 at 12:58 +0100, Ahmed Et-tanany wrote:
> Our problem is that when our customers use up all available replication slots for logical replication,
> our database management tasks that also require a slot fail (for example, creating the required
> replication slot for a new physical standby). Since increasing `max_replication_slots` requires
> One idea we have considered is patching PostgreSQL to add a new GUC parameter that would allow
> a superuser to reserve a certain number of replication slots usable only for management tasks.
> 
> Is this a known issue that might be addressed in PostgreSQL at some point? If not,

It is conceivable that somebody might change the behavior at some point (compare
"reserved_connections").  If you write or sponsor a patch, that would increase
the likelihood.

Right now, my only suggestion is to set "max_replication_slots" high.

Yours,
Laurenz Albe

---

From: Adrian Klaver <[email-masked]>
Date: Mon, 15 Dec 2025 08:25:23 -0800

> slots for logical replication,

The above would be the issue. Allowing customers to be DBA's for an 
installation that they are not ultimately responsible for does not seem 
sound to me. I would think a request mechanism is in order.

> 
> Thanks in advance.
> 
> Best regards,
> 
> -- 
> Ahmed Et-tanany
> Aiven: https://aiven.io/ <https://aiven.io/>

-- 
Adrian Klaver
[email-masked]