X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C9553D1EC4C for ; Tue, 23 Mar 2004 21:55:14 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 32531-01 for ; Tue, 23 Mar 2004 17:55:12 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 316B6D1CCDA for ; Tue, 23 Mar 2004 17:55:10 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i2NLt81Y010013 for ; Tue, 23 Mar 2004 21:55:08 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i2NLYaLo005111 for pgsql-admin@postgresql.org; Tue, 23 Mar 2004 21:34:36 GMT From: CoL X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Disable Trigger Date: Tue, 23 Mar 2004 22:37:20 +0100 Organization: Hub.Org Networking Services Lines: 21 Message-ID: References: <686B4177-7D0B-11D8-AD18-000A95AA0B44@cognitive.com> Reply-To: col@mportal.hu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040316 X-Accept-Language: en-us, en In-Reply-To: <686B4177-7D0B-11D8-AD18-000A95AA0B44@cognitive.com> To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/329 X-Sequence-Number: 12898 hi, Charles Haron wrote, On 3/23/2004 21:48: > Is there a way to temporarily disable a trigger without dropping and > re-adding it? if you ever use dump: pg_dump --disable-triggers ... off: UPDATE pg_catalog.pg_class SET reltriggers = 0 WHERE oid = 'tablename'::pg_catalog.regclass; on: UPDATE pg_catalog.pg_class SET reltriggers = (SELECT pg_catalog.count(*) FROM pg_catalog.pg_trigger where pg_class.oid = tgrelid) WHERE oid = 'tablename'::pg_catalog.regclass; C.