make postgresql more resilient to upgrades