Re: Problem after installing triggering function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem after installing triggering function
Дата
Msg-id 7946.1264610085@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem after installing triggering function  (Yan Cheng Cheok <yccheok@yahoo.com>)
Ответы Re: Problem after installing triggering function  (Yan Cheng Cheok <yccheok@yahoo.com>)
Список pgsql-general
Yan Cheng Cheok <yccheok@yahoo.com> writes:
> I have a stored procedure execute the following code :
>     INSERT INTO unit(fk_lot_id, cycle)
>     VALUES(_lotID, _cycle) RETURNING  * INTO _unit;
>     raise notice 'AFTER INSERT INTO UNIT,  _unit.unit_id = %', _unit.unit_id ;

> unit_id column, is an auto generated primary key. I will always get a non-null value.

> However, after I install a trigger function, and create a table named unit_0 inherit from table unit,

> NOTICE:  AFTER INSERT INTO UNIT,  _unit.unit_id = <NULL>

> will be printed.

If you installed it as a BEFORE trigger, the problem is here:

>     RETURN NULL;

That's suppressing the INSERT action.

            regards, tom lane

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: syntax error during function call
Следующее
От: "Aycock, Jeff R."
Дата:
Сообщение: Re: syntax error during function call