pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Flávio Suguimoto <flavio.suguimoto@pragyatechnologies.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problems with disabling triggers in Postgres 7.3.9
Date: Thu, 9 Mar 2006 11:04:44 -0300
Message-ID: <GFEGIFLJJCMGLBLAHILKIECGCGAA.flavio.suguimoto@pragyatechnologies.com> (raw)
In-Reply-To: <20060309135557.GA5489@surnet.cl>

Thanks Alvaro,

I know that is a hack but i don't have (that i know) other way to disable a
trigger.
The reason that i need to disable is that trigger will be called
recursively.

Let explain better my case, the trigger that i sent the code is called after
inserts in table participation but itself insert 3 more records in the
participation table. If i don't disable the trigger it will be calling
recursively...

There is another walk-around to avoi it?

regards,
Flávio Suguimoto

-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Alvaro Herrera
Sent: Thursday, March 09, 2006 10:56 AM
To: Flávio Suguimoto
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Problems with disabling triggers in Postgres 7.3.9


Flávio Suguimoto wrote:
> Hi all,
>
> I have a problem in a trigger that disable all the triggers of a table.
This
> error occurs randomly and my guess is that occurs when i have a lot of
> concurrents inserts in the table participation.
>
> The error is :  RelationBuildTriggers: 2 record(s) not found for rel
> participation

I don't know what's involved in this particular bug, but the short
answer is: don't update system catalogs directly.  Have your triggers
cope with the situation where you don't want to fire them in certain
cases.

System catalogs are delicate stuff; there are some caches that must be
maintained in a coherent manner.  Usually the catalogs do not follow
MVCC rules to the letter.  The "UPDATE pg_class" was used by pg_dump at
some point, but it was only a hack and I wouldn't expect it to work
correctly when multiple processes are involved.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq





view thread (7+ messages)  latest in thread

Message-ID: <GFEGIFLJJCMGLBLAHILKIECGCGAA.flavio.suguimoto@pragyatechnologies.com>
Permalink:  ../GFEGIFLJJCMGLBLAHILKIECGCGAA.flavio.suguimoto@pragyatechnologies.com/
Also on:    postgresql.org/message-id/GFEGIFLJJCMGLBLAHILKIECGCGAA.flavio.suguimoto@pragyatechnologies.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: flavio.suguimoto@pragyatechnologies.com, alvherre@commandprompt.com
  Subject: Re: Problems with disabling triggers in Postgres 7.3.9
  In-Reply-To: <GFEGIFLJJCMGLBLAHILKIECGCGAA.flavio.suguimoto@pragyatechnologies.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