Re: Order of triggers - totally lost

From: SZŰCS Gábor <surrano(at)mailbox(dot)hu>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Order of triggers - totally lost
Date: 2003-08-13 17:20:43
Message-ID: 005a01c361bf$3a1a5d40$0403a8c0@fejleszt4
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dear Jonathan,

thanks for your POV.

----- Original Message -----
From: "Jonathan Gardner" <jgardner(at)jonathangardner(dot)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 -------------------------------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message ProgHome 2003-08-13 17:58:23 Re: How to optimize this query ?
Previous Message Josh Berkus 2003-08-13 17:16:19 Re: Order of triggers - totally lost