trigger update delete

From: "Sim Zacks" <sim(at)compulab(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: trigger update delete
Date: 2005-07-03 08:22:31
Message-ID: da83sd$1i7g$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to write a trigger function that will do something when either a
row had been deleted or a field has been updated to null.

The problem I am having is determining in the function if this is a delete
or not. I would like to say:
if this is delete trigger or new.field1 is null then
...
end if

new.field1 dies when it is a delete trigger, as it is supposed to. But I
need the function to know the difference.

Any thoughts?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2005-07-03 08:38:02 Re: trigger update delete - found it
Previous Message Michael Fuhr 2005-07-03 06:21:02 Re: plpythonu and bytea