Does insert's "on conflict" clause not work for this usage?
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных