View Single Post

   
  #2 (permalink)  
Old 04-09-2008, 11:13 PM
Peter Eisentraut
 
Posts: n/a
Default Re: "Suspending" indexes and constraint updates

Am Dienstag, 4. Dezember 2007 schrieb Reg Me Please:
> Is there a way to "suspend" the index updates and the constraint checks
> before the inserts in order to later re-enable them and do a reindex?


You can disable foreign-key constraints (see ALTER TABLE ... DISABLE TRIGGER;
not quite obvious, but there is a trigger beneath each foreign key
constraint). But there is no general solution for all constraints and
indexes.

It might also be helpful to investigate the order in which pg_dump puts out
things, since it faces mostly the same issues. It puts index and constraint
creation at the end after the data load.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Reply With Quote