pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Albrecht Berger <berger1517@gmx.ch>
Cc: pgsql <pgsql-sql@postgresql.org>
Subject: Re: trigger : emulate "instead of" with before ?
Date: Fri, 13 Jun 2003 09:57:25 -0400
Message-ID: <352.1055512645@sss.pgh.pa.us> (raw)
In-Reply-To: <046801c331a2$0c483e70$a07ba8c0@wxp>
References: <046801c331a2$0c483e70$a07ba8c0@wxp>

"Albrecht Berger" <berger1517@gmx.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



view thread (4+ messages)

Message-ID: <352.1055512645@sss.pgh.pa.us>
Permalink:  ../352.1055512645@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/352.1055512645@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, berger1517@gmx.ch
  Subject: Re: trigger : emulate "instead of" with before ?
  In-Reply-To: <352.1055512645@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox