Re: Is there a way to know if trigger is invoked by the code from another trigger

From: Erik Jones <ejones(at)engineyard(dot)com>
To: Naoko Reeves <naoko(at)lawlogix(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a way to know if trigger is invoked by the code from another trigger
Date: 2009-10-12 17:36:15
Message-ID: 4834FE56-D719-43C4-AD6F-8FFE9BEE6151@engineyard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Oct 11, 2009, at 10:51 AM, Naoko Reeves wrote:

> Could you tell me if there is a way to know if trigger is invoked by
> the code from another trigger?
> For instance, table A Trigger deletes table B record. While in table
> B trigger, I want to know whether this was triggered from table A.

Nothing built in to show you that. You could, however, have your
trigger on table A make an insert or update to a record in some table
that the trigger on table B could then look for.

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2009-10-12 18:10:56 PostgreSQL Conference West, registration closing
Previous Message David Fetter 2009-10-12 16:45:26 Re: Re: [GENERAL] contrib/plantuner - enable PostgreSQL planner hints