Re: Some additional PostgreSQL questions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: schaefer(at)alphanet(dot)ch
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Some additional PostgreSQL questions
Date: 2002-05-28 14:38:06
Message-ID: 2976.1022596686@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

schaefer(at)alphanet(dot)ch writes:
> The funny thing is the DELETE not saying an error, but not deleting (which
> is good, but I would like an error).
>>
>> Then make your trigger raise an error. Returning NULL out of the

> It does:

Hm. The "NEW.lot" part will not work in an AFTER DELETE trigger (I'm a
bit surprised that it doesn't raise an error --- I guess it is inserting
a NULL instead). You want OLD.lot for the DELETE case.

I don't know why you are getting the DELETE 0 result, but it's not
because of this trigger. AFTER triggers can't suppress individual
row actions, because the action is already done --- the most they
can do is raise an error to abort the whole transaction. Perhaps
you still have a BEFORE trigger in there somewhere?

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Beckstette 2002-05-28 14:43:03 dynamic table names, determined by calling parameter
Previous Message Jan Wieck 2002-05-28 14:35:11 Re: Triggers and System Tables.