Does the server log have the details, per above?
I think it'd likely be enough to add the FKs one at a time, rather than all in one transaction.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных