Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3226F476CD9 for ; Thu, 12 Dec 2002 12:03:17 -0500 (EST) Received: from sccmmhc01.mchsi.com (sccmmhc01.mchsi.com [204.127.203.183]) by postgresql.org (Postfix) with ESMTP id DD5A3476A18 for ; Thu, 12 Dec 2002 12:00:58 -0500 (EST) Received: from perdue.net ([12.216.72.93]) by sccmmhc01.mchsi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021212170053.JLFE18244.sccmmhc01.mchsi.com@perdue.net> for ; Thu, 12 Dec 2002 17:00:53 +0000 Message-ID: <3DF8C0D7.7060907@perdue.net> Date: Thu, 12 Dec 2002 11:01:11 -0600 From: Tim Perdue User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021123 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: ON DELETE CASCADE Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/165 X-Sequence-Number: 10753 I'm trying to comb through my database and add ON DELETE CASCADE to a number of tables where I already have fkeys in place, but I'm having a hard time. ALTER TABLE project_task DROP CONSTRAINT "project_task_group_project_id_f" RESTRICT; ERROR: ALTER TABLE / DROP CONSTRAINT: project_task_group_project_id_f does not exist ALTER TABLE project_task ADD CONSTRAINT projecttask_groupprojectid_fk FOREIGN KEY (group_project_id) REFERENCES project_group_list(group_project_id) ON DELETE CASCADE; NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ALTER That command works, but now I think I have 2x as many triggers as I want. How do I get rid of the original triggers? alexandria=# \d project_task Table "project_task" Column | Type | Modifiers ------------------+------------------+----------------------- project_task_id | integer | not null default nextval('project_task_pk_seq'::text) group_project_id | integer | not null default '0' summary | text | not null default '' details | text | not null default '' percent_complete | integer | not null default '0' priority | integer | not null default '0' hours | double precision | not null default '0.00' start_date | integer | not null default '0' end_date | integer | not null default '0' created_by | integer | not null default '0' status_id | integer | not null default '0' Indexes: projecttask_projid_status Primary key: project_task_pkey Triggers: RI_ConstraintTrigger_51030049, RI_ConstraintTrigger_51030047, RI_ConstraintTrigger_4305858, RI_ConstraintTrigger_4305852, RI_ConstraintTrigger_4305846 After adding the new foreign key: Triggers: RI_ConstraintTrigger_51364957, ***new RI_ConstraintTrigger_51030049, RI_ConstraintTrigger_51030047, RI_ConstraintTrigger_4305858, RI_ConstraintTrigger_4305852, RI_ConstraintTrigger_4305846