Thanks for this, all looks good. Here is the consolidate patch rebased. If there are no further comments I propose to commit this in a few days time.
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных