Name a Postgres unique constraint email_unique on two tables and the second fails: "relation already exists". Check names are per table; anything backed by an index is per schema. Constraint naming, tested on 18.3, on the Schemity blog.…

schemity.comPostgreSQL Constraint Naming Convention: Which Pattern to Use, and How to Find the Names That Drifted - SchemitySchemity's guide to naming Postgres constraints and indexes: the pattern to pick, the 63-byte cut that makes two names collide, and a query for stale names.