Re: Order of triggers - totally lost - Mailing list pgsql-sql

From SZŰCS Gábor
Subject Re: Order of triggers - totally lost
Date
Msg-id 005a01c361bf$3a1a5d40$0403a8c0@fejleszt4
Whole thread Raw
In response to Order of triggers - totally lost  ("SZŰCS Gábor" <surrano@mailbox.hu>)
List pgsql-sql
Dear Jonathan,

thanks for your POV.

----- Original Message ----- 
From: "Jonathan Gardner" <jgardner@jonathangardner.net>
Sent: Wednesday, August 13, 2003 6:20 PM


> I try to avoid triggers unless it is completely obvious what they are
> doing and why I should use them. This tends to minimize the number of
> them hanging around. I am a programmer - python, perl mostly - so the
> logic flow of triggers isn't something I can keep a firm handle on all
> the time.

We prefer using triggers to protect the server as well as client logic and
even wizards (some of them have more than 100 graph vertices and edges) to
help the users avoid illegal operations. In short: double protection.

> My tables only end up with a couple of triggers, if any. I have a ton of

A couple of triggers for most tables, yes. But for over 100 tables, this is
a couple hundred triggers total. Is that what you meant?

> stored procedures lying around, however -- pretty much one for each
> "action" a user would take to modify the database. If a trigger
> triggers another trigger, they aren't dependant on the order thereof,
> or even the existance of the other trigger.
>
> You may also want to examine PostgreSQL's RULE system (CREATE RULE). I
> think some of your triggers may be interchangeable with rules.

You have a point there... not sure I'll have the time to experiment
(we are ordered to make only small changes to be easily commitable to the
in-production version)

G.
------------------------------- cut here -------------------------------



pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Order of triggers - totally lost
Next
From: Stephan Szabo
Date:
Subject: Re: How to optimize this query ?