I noticed that PostgreSQL >= 10 does not generate WAL if there are no transactions.
In previous versions, PostgreSQL generated WAL at the expiration of archive_timout
, because it wrote some empty transactions.
I want PostgreSQL to still generate WAL if no one writes to it. Does anyone know how to do this in versions starting from 10?
Best Answer
That must be because of commit 6ef2eba3f:
If you really need to have regular WAL activity, the cheapest way is to have a
cron
job that runsSELECT txid_current()
regularly.If you want to monitor replication, it is better to measure the lag in bytes, that is immune to this problem.