Hi, > PG already allows a new FK to be created with ADD CONSTRAINT ... NOT > VALID clause which can be validated later using ALTER TABLE ... > VALIDATE CONSTRAINT. > I guess what we are looking for here is the same but for existing FKs. > > i.e Something like > > `ALTER TABLE distributors ALTER CONSTRAINT distfk NOT VALID;` > `ALTER TABLE distributors VALIDATE CONSTRAINT distfk;` > I was wrong about this. ADD CONSTRAINT ... NOT VALID just postpones integrity existing on existing data. There is no equivalent for that when altering an existing FK. Maybe, DISABLE ALL TRIGGERS can mark the FKs as NOT VALID. ALTER TABLE ... VALIDATE CONSTRAINT would now report inconsistencies if any. Also, VALIDATE CONSTRAINT would have to verify that the trigger implementing FK is enabled. Hope/unsure if this would not break backwards compatibility. Regards, Nanda