Re: Disable Triggers

From: Terry Lee Tucker <terry(at)chosen-ones(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Disable Triggers
Date: 2008-02-21 16:44:25
Message-ID: 200802211144.25108.terry@chosen-ones.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 21 February 2008 11:26, A.M. wrote:
> On Feb 21, 2008, at 10:20 AM, Terry Lee Tucker wrote:
> > Greetings:
> >
> > We have been working diligently toward integrating Slony into our
> > production
> > databases. We've been having trouble with various tables, although
> > being
> > replicated perfectly in the initial replication stage, afterwards,
> > getting
> > out of sync.
> >
> > I have finally figured out what the problem is. We have a Perl
> > process that
> > continually updates certain columns across all databases. That Perl
> > process
> > calls a function we have written called disable_triggers which updates
> > pg_class, setting reltriggers to 0 for the given table, and then
> > later, after
> > the work is complete, resetting reltriggers to the original value.
> > Unfortunately, during this process, the Slony trigger is disabled
> > as well
> > which is causing our problem.
> >
> > My questions is this: how would I go about changing my function so
> > that all
> > the triggers EXCEPT the Slony trigger would be disabled? Any ideas?
> >
> > Version:
> > PostgreSQL 7.4.19 on i686-redhat-linux-gnu, compiled by GCC gcc
> > (GCC) 3.4.6
> > 20060404 (Red Hat 3.4.6-9)
>
> Couldn't your triggers check some flag to determine if they should
> continue?
>
> Cheers,
> M
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/

--
Thanks for the response. I do, in fact have a different function which can
disable any trigger by trigger name which works by creating an entry in a
table where, when the given trigger does fire, it checks for an entry in the
table at the top of the trigger and takes the appropiate action. The problem
is that the solution for disabling all triggers is used in several utility
programs and I'm trying to avoid changing a bunch of code.
I appreciate your input.

Work: 1-336-372-6812
Cell: 1-336-404-6987
email: terry(at)chosen-ones(dot)org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-02-21 17:01:44 Re: Mac ordering with locales
Previous Message hernan gonzalez 2008-02-21 16:34:15 text and bytea