A Postgres feature I took way too long to discover: exclusion constraints, which is essentially "unique by some function of a column value" instead of "unique by a column value":
<a href="https://www.postgresql.org/docs/13/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION" rel="nofollow">https://www.postgresql.org/docs/13/ddl-constraints.html#DDL-...</a>
SQL Assertions are incidentally the most requested feature for the Oracle database: <a href="https://community.oracle.com/tech/apps-infra/discussion/4390732/sql-assertions-declarative-multi-row-constraints" rel="nofollow">https://community.oracle.com/tech/apps-infra/discussion/4390...</a>