Обсуждение: Discerning user vs trigger based updates

Поиск
Список
Период
Сортировка

Discerning user vs trigger based updates

От
"Gauthier, Dave"
Дата:

Hi:

 

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?

 

Thanks in Advance

Re: Discerning user vs trigger based updates

От
Tom Lane
Дата:
"Gauthier, Dave" <dave.gauthier@intel.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
discernbetween when a user is updating a record in the table vs when the update trigger is reflexively calling itself.
Isthere 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