Skip site navigation (1) Skip section navigation (2)

Re: Is drop/restore trigger transactional?

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Craig James <cjames(at)emolecules(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Is drop/restore trigger transactional?
Date: 2012-08-08 00:29:02
Message-ID: 5021B2CE.9040706@ringerc.id.au (view raw or flat)
Thread:
Lists: pgsql-performance
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

In response to

Responses

pgsql-performance by date

Next:From: Merlin MoncureDate: 2012-08-08 00:42:17
Subject: Re: Is drop/restore trigger transactional?
Previous:From: Stefan KellerDate: 2012-08-08 00:07:48
Subject: Re: Slow query: Select all buildings that have >1 pharmacies and >1 schools within 1000m

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group