Re: 7.4 - TODO : alter table drop foreign key

Поиск
Список
Период
Сортировка
От Fernando Nasser
Тема Re: 7.4 - TODO : alter table drop foreign key
Дата
Msg-id 3DEFA62E.6020806@redhat.com
обсуждение исходный текст
Ответ на Re: 7.4 - TODO : alter table drop foreign key  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: 7.4 - TODO : alter table drop foreign key  ("Dan Langille" <dan@langille.org>)
Список pgsql-hackers
Dan Langille wrote:> On 5 Dec 2002 at 11:47, Dan Langille wrote:
> 
>>Primary key: watch_list_staging_pkey
>>Check constraints: "watch_list_stag_from_watch_list" 
>>((from_watch_list = 't'::bool) OR (from_watch_list = 'f'::bool))
>>                   "watch_list_stagin_from_pkg_info" ((from_pkg_info 
>>= 't'::bool) OR (from_pkg_info = 'f'::bool))
>>Triggers: RI_ConstraintTrigger_4278482,
>>          RI_ConstraintTrigger_4278488
>>
>>No mention of FK constraints.
> 
> 
> Found the solution:
> 
> 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


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

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.


Regards,
Fernando




-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: big text field -> message type 0x44
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] PostgreSQL Global Development Group Announces