| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера