Again, this is a lot of work to avoid master / slave with failover. Are you sure it's really needed for your situation?
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных