Re: "Suspending" indexes and constraint updates

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Reg Me Please <regmeplease(at)gmail(dot)com>
Subject: Re: "Suspending" indexes and constraint updates
Date: 2007-12-04 10:50:21
Message-ID: 200712041150.22075.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message x asasaxax 2007-12-04 10:57:15 Re: Transaction problem
Previous Message Christian Rengstl 2007-12-04 10:49:36 Re: Fwd: Re: Archiving problem on Windows