Re: Can one turn off constraints/indices temporarily?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kynn(at)panix(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Can one turn off constraints/indices temporarily?
Date: 2006-02-02 14:57:12
Message-ID: 12993.1138892232@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

<kynn(at)panix(dot)com> writes:
> Now, suppose that one had to insert many records at once. Is it
> possible to mimic the above strategy by turning off the constraints
> and indexing temporarily (without dropping them altogether), and
> turning them back on after all the inserts have been made.

No. You can drop and re-add them if you have a mind to. People
do this fairly often with indexes and foreign key constraints ---
there's no advantage in doing it for CHECK constraints though.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Swierczek 2006-02-02 15:19:36 pg_dump - sort data?
Previous Message kynn 2006-02-02 14:49:11 Can one turn off constraints/indices temporarily?