PostgreSQL Constraint for relation already exists
Constraint for relation already exists
The cause of error: There is already a constraint created with the same name.
Check the constraint name or drop the existing constraint.
Error message example
ALTER TABLE test.customers ADD CONSTRAINT fk_address FOREIGN KEY (address_id) REFERENCES test.customer_address (id);
Messages
ERROR: constraint “fk_address” for relation “customers” already exists