Mavrikii
Platinum Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору NiXXX Цитата: Подскажите новичку куда копать. | не пользуюсь postgresql, но навскидку.. Код: BEGIN insert into test.tbl_h select t.tbl_id, t.tbl_name, current_timestamp from test.tbl t; RETURN NULL; END; | уверены, что тут нужно возвращать NULL? вполне возможно, что это отменяет операцию обновления. Цитата: Trigger functions are always declared as “RETURNS trigger”, but what you actually have to return is for statement level triggers, the value NULL for row level triggers, a row of the table on which the trigger is defined The return value is ignored for row level AFTER triggers, so you may as well return NULL in that case. That leaves row level BEFORE triggers as the only interesting case. In row level BEFORE triggers, the return value has the following meaning: if the trigger returns NULL, the triggering operation is aborted, and the row will not be modified for INSERT and UPDATE triggers, the returned row is the input for the triggering DML statement Note also that you can have more than one row level BEFORE trigger on a table. In this case, the triggers are executed in the alphabetical order of their name, and the result of the previous trigger function becomes the input for the next trigger function. | ps: и вопрос не для сисадминов. http://forum.ru-board.com/forum.cgi?action=filter&forum=33&filterby=topictitle&word=postgre http://forum.ru-board.com/forum.cgi?action=filter&forum=31&filterby=topictitle&word=postgre | Всего записей: 15040 | Зарегистр. 20-09-2014 | Отправлено: 04:35 02-02-2023 | Исправлено: Mavrikii, 04:38 02-02-2023 |
|