Re: Proposal: More flexible backup/restore via pg_dump - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Proposal: More flexible backup/restore via pg_dump
Date
Msg-id Pine.BSF.4.10.10006271244500.40658-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Proposal: More flexible backup/restore via pg_dump  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
On Tue, 27 Jun 2000, Philip Warner wrote:

> But the problem is the constraints: AFAIK there is no 'ALTER TABLE ADD
> CONSTRAINT...' so PK, FK, Not Null constraints have to be applied before
> data load (*please* tell me I'm wrong). This also means that for large
> databases, I should apply indexes to make PK/FK checks fast, but they will
> slow data load.

Actually, there is an ALTER TABLE ADD CONSTRAINT for foreign key
constraints.  Of course, if the existing data fails the constraint the
constraint doesn't get made. and if you're in a transaction, it'll force
a rollback.
In fact, you really can't always apply foreign key constraints at
schema reload time because you can have tables with circular
dependencies.  Those would have to be created after data load.



pgsql-hackers by date:

Previous
From: "Mitch Vincent"
Date:
Subject: Trigger question
Next
From: "Scott Winterstein"
Date:
Subject: database into website