Yeah, a cron job to swap pg_hba.conf files is the best solution I've come up with so far. It's not one web app, it's closer to two dozen of them, on multiple sites.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных