disallowed-unique-constraint
#
problemAdding a UNIQUE
constraint requires an ACCESS EXCLUSIVE
lock which blocks reads and writes to the table while the index is built.
#
solutionInstead create an index CONCURRENTLY
and create the CONSTRAINT
USING
the index.
https://www.postgresql.org/docs/current/sql-altertable.html
Instead of:
Use:
Instead of:
Use: