Here are rebased patches, their was a conflict with a recent commit in contrib/pg_upgrade.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных