Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0CBDE4758BD for ; Sun, 24 Nov 2002 10:35:45 -0500 (EST) Received: from localdomain (m1.xenion.de [62.8.212.158]) by postgresql.org (Postfix) with ESMTP id 0D04B47580B for ; Sun, 24 Nov 2002 10:35:44 -0500 (EST) Received: from usco.de [213.39.243.105] by localdomain with Novonyx SMTP Server $Revision: 2.75.1.9 $; Sun, 24 Nov 2002 16:36:35 +0100 (ECTD) Message-ID: <3DE0F239.6992F841@usco.de> Date: Sun, 24 Nov 2002 16:37:29 +0100 From: Egon Reetz X-Mailer: Mozilla 4.8 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Cc: pgsql-admin@postgresql.org Subject: Re: Dropping Foreign Key without recreating table References: <3DE0D886.4DE837BB@usco.de> <57142.203.145.129.4.1038147124.squirrel@mail.trade-india.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/235 X-Sequence-Number: 6423 Thanks Mallah, I didn't realize the name of the trigger is in mixed case. However, I had to drop another 2 triggers on the referenced table. So it looks for me, a foreign key uses 3 triggers at all. Looking into pg_trigger, I found them all. Thanks Egon mallah@trade-india.com wrote: > Oops disregard my prev reply, > > "RI_ConstraintTrigger_17195" is a trigger not contraint so u must in 7.2.1 do > DROP TRIGGER "RI_ConstraintTrigger_17195" on mytable ; > > in 7.3 foreign key constraints on tables have name. > so you need not drop underlying triggers like in 721 but can use command to > drop the contraint which u are attempting now like > alter table mytable drop constraint "NAME OF THE FKEY CONSTRAINT" restrict ; > > cheers > mallah. > > > I wanted to change a foreign key to be deferrable (db version 7.2.1). During table creation I > > didn't specify a constraint name for the foreign key. > > "\d" shows a trigger RI_ConstraintTrigger_17195, however when I'm trying to "alter table > > mytable drop constraint RI_ConstraintTrigger_17195 restrict" I'm getting the error "constraint > > does not exist. > > What am I doing wrong here? Or is there another simple solution to switch foreign keys to be > > deferrable? > > > > Regards > > > > Egon > > > > > > > > ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off > > all lists at once with the unregister command > > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > ----------------------------------------- > Get your free web based email at trade-india.com. > "India's Leading B2B eMarketplace.!" > http://www.trade-india.com/