I pushed the small preliminary patches. Here's a rebase of the main patch.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных