Re: A Referntial integrity

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: A Referntial integrity
Дата
Msg-id 016101bfe84d$55e3c6e0$0c64010a@kick.com
обсуждение исходный текст
Ответ на A Referntial integrity  ("Niraj Bhatt" <nirajb@mahindrabt.com>)
Список pgsql-general
Actually, you should (hopefully) be able to drop
t2.  That is supposed to remove the constraints
referencing it (technically speaking drop table is
probably supposed to take an argument to
determine whether to do this, but we don't yet).

If it's actually failing for you, can you give us a
copy of the error message you're getting?

You will need to recreate the constraint between
t1 and t2 when you re-add t2 using alter table
add constraint.

----- Original Message -----
From: Niraj Bhatt
To: pgsql-general@postgresql.org
Cc: balpannu1@aol.com
Sent: Thursday, July 06, 2000 7:29 AM
Subject: [GENERAL] A Referntial integrity


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 по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: proposed improvements to PostgreSQL license
Следующее
От: ryan
Дата:
Сообщение: Sig 11 bug