pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Craig James <cjames@emolecules.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Is drop/restore trigger transactional?
Date: Wed, 08 Aug 2012 08:29:02 +0800
Message-ID: <5021B2CE.9040706@ringerc.id.au> (raw)
In-Reply-To: <CAHyXU0xGcCQ=aNd1BtBLJpUq0HKJJ11hy=LEdZMoPJtshoiDcA@mail.gmail.com>
References: <CAFwQ8rfBDpt8qsPeRigM1Fnivm4ZCdxx_yRoVYg1_4eWXuZg5w@mail.gmail.com>
	<CAHyXU0xGcCQ=aNd1BtBLJpUq0HKJJ11hy=LEdZMoPJtshoiDcA@mail.gmail.com>

On 08/08/2012 04:15 AM, Merlin Moncure wrote:
> IF current_user = 'bulk_writer' THEN
>    return new;
> END IF;
> <expensive stuff>
... 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



view thread (13+ messages)  latest in thread

Message-ID: <5021B2CE.9040706@ringerc.id.au>
Permalink:  ../5021B2CE.9040706@ringerc.id.au/
Also on:    postgresql.org/message-id/5021B2CE.9040706@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: ringerc@ringerc.id.au, mmoncure@gmail.com, cjames@emolecules.com
  Subject: Re: Is drop/restore trigger transactional?
  In-Reply-To: <5021B2CE.9040706@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox