Search Postgresql Archives

Re: Problem after installing triggering function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yan Cheng Cheok <yccheok@xxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux