Thread: Can pg_restore also disable table CHECK contraint?

Can pg_restore also disable table CHECK contraint?

From
"CN"
Date:
Hi!

Some of my tables include table check constraints like this:

CREATE TABLE t1 (
CHECK(MyCheckFun(c1,c2)),
c1 int,
c2 int
) without oids;

Function MyCheckFun() references to another table and checks if the
related rows exist. MyCheckFun() raises exception and aborts pg_restore
due to the uncontrolled restore order of tables data.

Option --disable-triggers appears to be not disabling CHECK in such
case. Probably my requirement is exordinary, but is it possible to
"enhance" pg_restore so that it also ignores CHECK constraint?

Thanks!

CN