Re: 7.4 - TODO : alter table drop foreign key

From: "Dan Langille" <dan(at)langille(dot)org>
To: Fernando Nasser <fnasser(at)redhat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4 - TODO : alter table drop foreign key
Date: 2002-12-05 19:51:34
Message-ID: 3DEF67F6.2579.72DA333@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5 Dec 2002 at 14:17, Fernando Nasser wrote:

> Dan Langille wrote:> On 5 Dec 2002 at 11:47, Dan Langille wrote:
> >
> > drop trigger "RI_ConstraintTrigger_4278488" on watch_list_staging;
> >
>
> You should now go to the table this RI constraint was referring to and delete
> the two triggers in there as well. They will still be checking for deletions
> and updates. Look for something like
> RI_ConstraintTrigger_4278490
> RI_ConstraintTrigger_4278492
> and with the associated procedure RI_FKey_noaction_del and RI_FKey_noaction_upd

Oh thank you! I didn't know about those. FWIW, I've just documented
this exercise at http://www.freebsddiary.org/postgresql-dropping-
constraints.php so corrections are most welcome.

> BTW, the rhdb-admin program can drop the constraints for you, even the unnamed
> ones on backends 7.2 up. You can download it from:
>
> http://sources.redhat.com/rhdb

Thanks. I hope to check that out one day.

> Of course, now that you broke the set of triggers for this FK constraint you'll
> still need to drop the other ones by hand. But the tool at least will show you
> the column and table involved so it will be easier to identify the two you have
> to get rid of.

I did the identification by hand and fixed it up that way. Hopefully
there's nothing else in there I've done wrong.

--
Dan Langille : http://www.langille.org/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-12-05 19:52:08 Re: 7.4 - TODO : alter table drop foreign key
Previous Message Bruce Momjian 2002-12-05 19:25:30 Re: PQnotifies() in 7.3 broken?