A Referntial integrity

Поиск
Список
Период
Сортировка
От Niraj Bhatt
Тема A Referntial integrity
Дата
Msg-id 000801bfe756$a6ab2160$9c02040a@mahindrabt.com
обсуждение исходный текст
Список pgsql-general
Hello,
 
We are using a postgresql-7.0.2. Consider the following scenario
 
we have created a table t1 with columns
 
c1   :   having referential integrity with t2.c1
c2   :   having referential integrity with t3.c2
 
where t2 and t3 are different tables

Assume that t2 has also got a referential integrity with t4.c3 where c3 is a column in t2 as well.
 
Now I want to drop a constraint of table t2 that is referring to t4.c3. As per the documentation one can not drop a constraint in alter table command. In this situation I need to drop the table t2. But I can not drop this table since it has got child in table t1.
Do I need to drop t1 as well ?? This one is a classical example of master detail - detail relation ship with dependent details which is very trivial in real world. Infect in more complex design such detail - detail relationship can go upto several levels. Every time dropping a table is not good. Is there any other way to do this?? Please elaborate on this
 
Regards
 
Niraj Bhatt 

В списке pgsql-general по дате отправления:

Предыдущее
От: mikeo
Дата:
Сообщение: foreign key lost
Следующее
От: Tom Lane
Дата:
Сообщение: Re: foreign key lost