Delete triggers - Mailing list pgsql-bugs

From Mathew Frank
Subject Delete triggers
Date
Msg-id 0a9801c2f9dd$8210e870$0a00a8c0@dax
Whole thread Raw
Responses Re: Delete triggers
List pgsql-bugs
I have had a lot of trouble getting a DELETE trigger to do nothing (ie let =
the delete operation occur instead of cancelling it, as required)

The documentation on this is very thin on the ground - I`ve just spend 4 Ho=
urs googling and the best I could find was one of the main developers (Bruc=
e?? sorry - too long ago) replying to an email in 2001.    Which was to NOT=
 cancel the delete operation, you need to return NEW or OLD.

 - If I return NULL the operation is cancelled.  ("DELETE 0")
 - If I return NEW the operation is cancelled.  ("DELETE 0") Now NEW is not=
 set for a delete (because it would make no sense) so I am thinking this is=
 the same as returning NULL
 - If I return OLD the operation is cancelled ("DELETE 0").

I am using the 7.2 version.


To me this is either a bug in the system, or a 'bug' in the documentation. =
  Look forward to hearing from you.

Cheers,
Mathew

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #931: bugs "create user" "alter user"
Next
From: Tom Lane
Date:
Subject: Re: Delete triggers