Re: Problem after installing triggering function - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem after installing triggering function
Date
Msg-id 7946.1264610085@sss.pgh.pa.us
Whole thread Raw
In response to Problem after installing triggering function  (Yan Cheng Cheok <yccheok@yahoo.com>)
Responses Re: Problem after installing triggering function  (Yan Cheng Cheok <yccheok@yahoo.com>)
List 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 by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: syntax error during function call
Next
From: "Aycock, Jeff R."
Date:
Subject: Re: syntax error during function call