PostgreSQL CHECK Constraints: Row-Local Rules and Why Cross-Row Comparisons Break Dumps
PostgreSQL CHECK constraints may only reference the row being inserted or updated. A CHECK that compares against other rows can pass simple tests yet fail during pg_dump restore, because rows load in an order that may not satisfy it.
postgresql / constraints / check-constraint / data-integrity / dump-restore / ddl