We're running a backup process based on pg_basebackup
of a Postgres 14.5 database that creates a lot of WAL archive files and using up huge amounts of disk space. As we don't really need the WAL archive, I thought to disable WAL archiving and I changed these values (everything else is pure default):
archive_mode = off # was 'on' before
wal_level = minimal # was 'replica' before (there's only a single db instance running)
max_wal_senders = 0 # was '10' before (but wal_level = minimal seems to require '0')
Maybe there's no real need to lower the wal_level
from replica
to minimal
, but the WAL documentation states what seems exactly sufficient for my less than critical database:
minimal
removes all logging except the information required to recover from a crash or immediate shutdown.
Unfortunately, after the above configuration, the backup process now fails with this error:
FATAL: number of requested standby connections exceeds max_wal_senders (currently 0)
In other words, max_wal_senders
must be zero and also greater than zero at the same time! What can I do to get out of this deadlock?