Re: trigger : emulate "instead of" with before ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Albrecht Berger" <berger1517(at)gmx(dot)ch>
Cc: "pgsql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: trigger : emulate "instead of" with before ?
Date: 2003-06-13 13:57:25
Message-ID: 352.1055512645@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Albrecht Berger" <berger1517(at)gmx(dot)ch> writes:
> I need a trigger which is updating a delete flag of a row instead of
> deleting it physically.

> How do I implement a trigger which doesn't execute a delete without raising
> an exception in plsql ?

If the BEFORE DELETE trigger returns NULL, the delete is skipped.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Demidem Mohamed Amine 2003-06-13 15:07:43 create tables within functions
Previous Message Jeff Eckermann 2003-06-13 13:50:10 Re: trigger : emulate "instead of" with before ?