foreign keys

Поиск
Список
Период
Сортировка
От Radoslaw Stachowiak
Тема foreign keys
Дата
Msg-id 20000806000544.A17715@blue.alter.pl
обсуждение исходный текст
Ответы Re: foreign keys  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: libperl.so
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: foreign keys