Re: Some additional PostgreSQL questions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Some additional PostgreSQL questions
Дата
Msg-id 2976.1022596686@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Some additional PostgreSQL questions  (schaefer@alphanet.ch)
Список pgsql-sql
schaefer@alphanet.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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Triggers and System Tables.
Следующее
От: "Michael Beckstette"
Дата:
Сообщение: dynamic table names, determined by calling parameter