pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: mallah@trade-india.com
Cc: pgsql-sql@postgresql.org
Subject: Re: disabling triggers
Date: Tue, 17 Jun 2003 11:49:44 -0700
Message-ID: <200306171149.44425.josh@agliodbs.com> (raw)
In-Reply-To: <1182.219.65.230.103.1055875666.squirrel@mail.trade-india.com>
References: <1164.219.65.230.103.1055871254.squirrel@mail.trade-india.com>
	<200306171131.24578.josh@agliodbs.com>
	<1182.219.65.230.103.1055875666.squirrel@mail.trade-india.com>

Mallah,

> in past we tried creating a plpgsql function that takes  relname and schema
> and try setting reltriggers=0 on disabling and  = (select count(*) from 
pg_trigger
> for that relname and schema) on enabling .
> 
> we got stuck somewhere and abandoned it , do u think above approach
> would work in principle ?

Yes.  As I said, I've used it before.  

An additional safeguard you can use is enclosing everything in a transaction, 
that is:

BEGIN
disable triggers
load data
enable triggers
END

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




view thread (8+ messages)  latest in thread

Message-ID: <200306171149.44425.josh@agliodbs.com>
Permalink:  ../200306171149.44425.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200306171149.44425.josh@agliodbs.com

 · 

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-sql@postgresql.org
  Cc: josh@agliodbs.com, mallah@trade-india.com
  Subject: Re: disabling triggers
  In-Reply-To: <200306171149.44425.josh@agliodbs.com>

* 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