Re: A Referntial integrity

From: "Stephan Szabo" <sszabo(at)kick(dot)com>
To: "Niraj Bhatt" <nirajb(at)mahindrabt(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: A Referntial integrity
Date: 2000-07-07 19:55:43
Message-ID: 016101bfe84d$55e3c6e0$0c64010a@kick.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
Cc: balpannu1(at)aol(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message D Herssein 2000-07-07 20:47:49 [Help] INSTALLing 7.02
Previous Message Jan Wieck 2000-07-07 19:47:10 Re: Re: [SQL] Re: [GENERAL] lztext and compression ratios...