Re: Proposal: More flexible backup/restore via pg_dump

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal: More flexible backup/restore via pg_dump
Date: 2000-06-27 20:10:00
Message-ID: Pine.BSF.4.10.10006271244500.40658-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-06-27 21:00:11 Re: Big 7.1 open items
Previous Message Mitch Vincent 2000-06-27 19:54:11 Trigger question