Re: Discerning user vs trigger based updates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Discerning user vs trigger based updates
Date: 2010-11-23 17:21:28
Message-ID: 11364.1290532888@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> I have an update trigger on a table that in turn updates other records of that same table. I need to be able to discern between when a user is updating a record in the table vs when the update trigger is reflexively calling itself. Is there an elegant way to do this?

No. Generally that sort of design is a foot-gun ... you should
reconsider the schema arrangement that requires this.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Tripathy 2010-11-23 17:44:32 Syntax error near returning
Previous Message Gauthier, Dave 2010-11-23 17:13:38 Discerning user vs trigger based updates