Re: "Suspending" indexes and constraint updates

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

Il Tuesday 04 December 2007 11:50:21 Peter Eisentraut ha scritto:
> 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.

As far as I know, pg_dump usually starts with an empty DB.
Then it creates plain table to be filled with COPY.
And at last it creates indexes and constraints.
Which is not what I nedd.

In any case thanks for the hint.

--
Reg me, please!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2007-12-04 11:03:31 Re: Archiving problem on Windows
Previous Message Martijn van Oosterhout 2007-12-04 10:57:41 Re: "Suspending" indexes and constraint updates