Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4E9FD2E8109 for ; Tue, 7 Aug 2012 21:29:24 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Syu9L-0000nF-Ip for pgsql-performance@postgresql.org; Wed, 08 Aug 2012 00:29:23 +0000 Received: by pbbrr13 with SMTP id rr13so496168pbb.19 for ; Tue, 07 Aug 2012 17:29:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=a60m2SF1psS7SNHUogd1oSG/vTs2195vQTcOtEcJvDE=; b=L16iML2UCpjhQDvEsNEN0J3Bjc0zKJ9tXJnwmHpnWzNI2p0RXMZBJjszLY8f8sodxI 2hlSyJucx9pWxH2YrIT8fxp+9Q/XxlWmKgJApfEKW1S7aybHVa2H0mrARDsfPFfsCLTr J7TGR1wNeXNYZJ/yJLP39sa6l6e4Ghho1JTtid9m/+RG2Tt4MZT9bZFsID2zqt+SiiXv QRLKT4QSxCY2HpYGRUg+Xx/mw/ubScAf3e70roHd/qELLvvPwOoLp55GlClCpzB+rbkN WdW0FxP09eEM/RqcPJymGWD4yYBHj1AbijSsQWb4RgQohXvyHPY7uUL+JpBckC5G/uG+ IRog== Received: by 10.68.234.6 with SMTP id ua6mr32110397pbc.117.1344385750994; Tue, 07 Aug 2012 17:29:10 -0700 (PDT) Received: from ayaki.localdomain ([106.71.64.31]) by mx.google.com with ESMTPS id pq1sm12144896pbb.3.2012.08.07.17.29.07 (version=SSLv3 cipher=OTHER); Tue, 07 Aug 2012 17:29:10 -0700 (PDT) Message-ID: <5021B2CE.9040706@ringerc.id.au> Date: Wed, 08 Aug 2012 08:29:02 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Merlin Moncure CC: Craig James , pgsql-performance@postgresql.org Subject: Re: Is drop/restore trigger transactional? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkUJETiCR+4dkfziW7i/JCBymlTrdT7WMWRnPJA5lFpfUbFtL/clzQ7kHekTkFzunRKpMZM X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/52 X-Sequence-Number: 47590 On 08/08/2012 04:15 AM, Merlin Moncure wrote: > IF current_user = 'bulk_writer' THEN > return new; > END IF; > ... or re-create the trigger with a `WHEN` clause (only available in newer Pg versions, see CREATE TRIGGER) that excludes the migrated customer ID. You'd have to do it in a new tx to avoid locking the table for ages though. -- Craig Ringer