This issue was originally created by @anoadragon453 at matrix-org/sygnal#171.
A somewhat recent change in Synapse enabled by default the behaviour of reconnecting to the Postgres database after losing connection automatically.
We likely want to consider doing the same for Sygnal.
https://github.com/matrix-org/sygnal/blob/e1b9eb8a4ad5457b793e0271e354058930587b8a/sygnal/sygnal.py#L150-L155