On 2025-May-28, jian he wrote:
> hi.
>
> create table t(a int, constraint cc check(a = 1));
> ALTER TABLE t ALTER CONSTRAINT cc not valid;
> ERROR: FOREIGN KEY constraints cannot be marked NOT VALID
> LINE 1: ALTER TABLE t ALTER CONSTRAINT cc not valid;
> ^
>
> the error message seems misleading,
We discussed this already, didn't we? There's a thread with IIRC three
proposed patches for this. I think I liked this one the most:
https://postgr.es/m/CAAJ_b97hd-jMTS7AjgU6TDBCzDx_KyuKxG+K-DtYmOieg+giyQ@mail.gmail.com
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Computing is too important to be left to men." (Karen Spärck Jones)