Re: trigger without trigger call

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Philipp Kraus <philipp(dot)kraus(at)tu-clausthal(dot)de>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: trigger without trigger call
Date: 2013-10-14 07:06:09
Message-ID: CAFj8pRDbu+M=WnRn25L8FH-UtSCAcQP+UQmrqqd5ZC30NhGBYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

you can disable trigger by ALTER TABLE tablename DISABLE TRIGGER
triggername;

but it should be executed with owner rights on table.

This statement works perfect, but a fact, so you need it signalize so you
do some wrong. Triggers should to be used primary for checking, logging,
calculating some simply calculated values. Anything else is can carry some
very negative effects with impacts on readability or performance (although
sometimes it is necessary). Try to move some logic from triggers to
functions with explicit call.

Regards

Pavel Stehule

2013/10/14 Philipp Kraus <philipp(dot)kraus(at)tu-clausthal(dot)de>

> Hello,
>
> I have written a update & delete trigger of a table.
> My delete trigger runs an update statement but this create a (semantic)
> problem.
> How can I disable the update trigger for only this update call within the
> delete trigger?
> So my delete trigger need not call the update trigger
>
> Thanks
>
> Phil
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jesse Long 2013-10-14 07:51:04 Re: Incorrect index being used
Previous Message Philipp Kraus 2013-10-14 06:18:16 trigger without trigger call