X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 476F8DAE9D for ; Tue, 25 Oct 2005 22:03:49 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03429-08 for ; Wed, 26 Oct 2005 01:03:44 +0000 (GMT) Received: from challengelogistics.com.au (unknown [203.48.241.83]) by svr1.postgresql.org (Postfix) with ESMTP id 2951ADAEB8 for ; Tue, 25 Oct 2005 22:03:43 -0300 (ADT) Received: from isis.challengelogistics.com.au ([192.168.160.31]) by sameagle with InterScan Messaging Security Suite; Wed, 26 Oct 2005 11:03:43 +1000 Received: from sandy01.challengelogistics.com.au ([192.168.160.3]) by isis.challengelogistics.com.au with Microsoft SMTPSVC(6.0.3790.1830); Wed, 26 Oct 2005 11:05:38 +1000 From: "Bath, David" Reply-To: dave.bath@unix.net To: pgsql-sql@postgresql.org Subject: ?Equiv to oracle (ENABLE|DISABLE) (CONSTRAINT|TRIGGER) statements? Date: Wed, 26 Oct 2005 11:13:43 +1000 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510261113.43685.dave.bath@unix.net> X-OriginalArrivalTime: 26 Oct 2005 01:05:38.0859 (UTC) FILETIME=[60FA2FB0:01C5D9C9] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.072 required=5 tests=[AWL=0.072] X-Spam-Level: X-Archive-Number: 200510/297 X-Sequence-Number: 23150 Folks, Summary: Does postgresql have equivalents to the following Oracle statements? DISABLE CONSTRAINT ... ENABLE CONSTRAINT ... DISABLE TRIGGER ... ENABLE TRIGGER ... Background: One of the advantages of Oracle over some competitors such as MS-SQL and Sybase is the ability to toggle a constraint or trigger on and off, without blatting it, and without the hassle of finding any code and any accessory information (like comments, permissions...). BTW, I personally put C-style comments at the front of the clause so I can get the why's/how's into the syscatalogs - but I wear jackboots where documentation is concerned :-) and get at these for autodoccing and/or generation of meaningful messages to users when raising exception messages from the server. This capability is especially useful when there is some disgusting data-munging by a DBA, not just for import/export. I've tried grovelling through the sql from a pg_dump invoked with --disable-triggers, but it has no enable/disable triggers or constraints, merely creating primary/foreign constraints AFTER issuing the COPY. Yep, I'd expect this ONLY to work when issued by someone with DBA privs (and maybe the target object owner, although I imagine reasons that /might/ be a bad idea for paranoid info management governance). Thanks in advance -- David T. Bath dave.bath@unix.net