Very interesting. But is the sort overhead worth it? Why not make the constraint deferrable before the update and switchback afterwards?
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных