The procedure works fine on the primary but reports a bunch of errors on the read-only standbys.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных