pg_dump and ALTER TABLE / ADD FOREIGN KEY

From: "Rod Taylor" <rbt(at)zort(dot)ca>
To: "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_dump and ALTER TABLE / ADD FOREIGN KEY
Date: 2002-06-22 16:11:56
Message-ID: 06ce01c21a07$87fa0d40$fe01a8c0@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

With the pg_depend / pg_constraint implementation foreign keys are
applied to dumps via alter table / add foreign key (retains inter
table dependencies).

Some have expressed that this could be quite slow for large databases,
and want a type of:

SET CONSTRAINTS UNCHECKED;

However, others don't believe constraints other than foreign keys
should go unchecked.

That said, is this functionality wanted outside of pg_dump /
pg_restore?

Or would the below be more appropriate?:
ALTER TABLE tab ADD FOREIGN KEY .... TRUST EXISTING DATA;

That is, it will not check pre-existing data to ensure it's proper.
The assumption being that pg_dump came from an already consistent
database. Needs better wording.

--
Rod

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Kernell 2002-06-22 16:48:12 computer for todo list
Previous Message Curt Sampson 2002-06-22 08:41:30 Re: Index Scans become Seq Scans after VACUUM ANALYSE