Returning NEW in an on-delete trigger

From: "Michael Nolan" <htfoot(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Returning NEW in an on-delete trigger
Date: 2008-09-18 18:21:20
Message-ID: 4abad0eb0809181121g625cb397qbd40ece12afecd7a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Recently I discovered a coding error of mine in a trigger that is called
only for deletes.

I was returning NEW instead of OLD.

Since NEW is undefined when deleting a row, it was failing and the row
wasn't being deleted.

However, it was failing silently. Shouldn't this have recorded an error or
warning somewhere?
--
Mike Nolan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2008-09-18 19:00:32 Re: Returning NEW in an on-delete trigger
Previous Message Simon Riggs 2008-09-18 18:18:52 Re: Running initdb while logged in as Administrator user (Windows)