foreign keys - Mailing list pgsql-general

From Radoslaw Stachowiak
Subject foreign keys
Date
Msg-id 20000806000544.A17715@blue.alter.pl
Whole thread Raw
Responses Re: foreign keys  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Could someone explain me some fact about FK handling in postgresql (7.0.2) ?

1. WHen I create table with foreign key to other one ( with ON UPDATE CASCADE),
i get two constraints for created table: one for insert one for update.
Additionaly there is created constraint (on rows deletion) in referenced table

2. when I pg_dump whole database all of them are saved OK.

3. when I pg_dump just the new table (created) the third constraint is not
dumped cause it's "connected" to referenced table.

Due to the fact that many ALTER TABLE xxx commands are not implemented
this can lead to loss of database "knowledge" during modification of
tables structured.

Of course manipulation of such loose constraints is extremly
uncomfortable;

Not to mentions fact that in a few places in docs it's shown as a method
for copying table "SELECT... INTO" which does not "take" keys with it
leading to database knwoledge loss.

Maybe there is something wchich I missed or misunderstanded in FK handling
in postgres? Could someone explain me this, please?

--
radoslaw.stachowiak.........................................http://alter.pl/

pgsql-general by date:

Previous
From: Lamar Owen
Date:
Subject: Re: libperl.so
Next
From: Bruce Momjian
Date:
Subject: Re: foreign keys