pg_dump and ALTER TABLE / ADD FOREIGN KEY - Mailing list pgsql-hackers

From Rod Taylor
Subject pg_dump and ALTER TABLE / ADD FOREIGN KEY
Date
Msg-id 06ce01c21a07$87fa0d40$fe01a8c0@jester
Whole thread Raw
Responses Re: pg_dump and ALTER TABLE / ADD FOREIGN KEY
List 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



pgsql-hackers by date:

Previous
From: Curt Sampson
Date:
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Next
From: "Robert Kernell"
Date:
Subject: computer for todo list