disable the DEFERRED mode of constraints.
That is not currently possible in SQL, so I wrote this patch. Without
this you have to drop and then re-add a constraint, which is
impractical for large tables.
CREATE TABLE fktable (id integer, fk integer REFERENCES pktable (id));
ALTER TABLE foo
ALTER CONSTRAINT fktable_fk_fkey DEFERRED INITIALLY IMMEDIATE;
Includes docs and tests.
Currently works for FKs only. Potentially other constraints can be
supported in future.
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services