Re: Problem after installing triggering function
От | Yan Cheng Cheok |
---|---|
Тема | Re: Problem after installing triggering function |
Дата | |
Msg-id | 824574.71366.qm@web65716.mail.ac4.yahoo.com обсуждение исходный текст |
Ответ на | Problem after installing triggering function (Yan Cheng Cheok <yccheok@yahoo.com>) |
Список | pgsql-general |
Sorry. Some correction. Change But... I am not implementing table partition to But... I am *now* implementing table partition Thanks and Regards Yan Cheng CHEOK --- On Thu, 1/28/10, Yan Cheng Cheok <yccheok@yahoo.com> wrote: > From: Yan Cheng Cheok <yccheok@yahoo.com> > Subject: Re: [GENERAL] Problem after installing triggering function > To: "Tom Lane" <tgl@sss.pgh.pa.us> > Cc: pgsql-general@postgresql.org > Date: Thursday, January 28, 2010, 8:53 AM > > Thanks and Regards > Yan Cheng CHEOK > > > --- On Thu, 1/28/10, Tom Lane <tgl@sss.pgh.pa.us> > wrote: > > > From: Tom Lane <tgl@sss.pgh.pa.us> > > Subject: Re: [GENERAL] Problem after installing > triggering function > > To: "Yan Cheng Cheok" <yccheok@yahoo.com> > > Cc: pgsql-general@postgresql.org > > Date: Thursday, January 28, 2010, 12:34 AM > > 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: > > > > You are right. I am inserting BEFORE trigger. > > CREATE TRIGGER insert_unit_trigger > BEFORE INSERT ON unit > FOR EACH ROW EXECUTE PROCEDURE > unit_insert_trigger(); > > > > > RETURN NULL; > > > > That's suppressing the INSERT action. > > > > > > But... I am not implementing table partition. I want to > ensure my parent table "unit" is empty, and "unit_0" is > being filled. But, all my query can be performed through > parent table "unit". > > I am referring to http://www.if-not-true-then-false.com/2009/11/howto-create-postgresql-table-partitioning-part-1/ > > > > regards, tom lane > > > > -- > > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > > To make changes to your subscription: > > http://www.postgresql.org/mailpref/pgsql-general > > > > > >
В списке pgsql-general по дате отправления: