Re: How to fire triggers just on "top" level DML

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "A(dot)M(dot)" <agentm(at)themactionfaction(dot)com>
Cc: "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to fire triggers just on "top" level DML
Date: 2011-01-19 22:57:44
Message-ID: 4D3718080200002500039844@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"A.M." <agentm(at)themactionfaction(dot)com> wrote:

> If you do implement TG_DEPTH, I am curious as to what the
> difference between TG_DEPTH==34 and TG_DEPTH==35 could mean. I
> think it might cause poor coding practice in making decisions
> based off assumed trigger order execution. Since you only care to
> distinguish between depth 1 and depth 2 (and not beyond), could
> you elaborate on a use case where further trigger "depth"
> information may be useful?

Well, our current trigger engine in the Java tier keeps a count like
that and has a depth limit to protect against runaway recursion.
The only time we hit it was in purge logic, which is extremely
convoluted due to requirements of statutes, supreme court rules, and
auditor requirements. :-/ I might just put some sort of depth
check into triggers fired during purges, to provide a more
informative message than I might otherwise get.

-Kevin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Grittner 2011-01-19 22:59:17 Re: How to fire triggers just on "top" level DML
Previous Message Bill Moran 2011-01-19 22:54:52 Re: ERROR: index row requires 9984 bytes, maximum size is 8191