Re: Problem after installing triggering function

From: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem after installing triggering function
Date: 2010-01-28 01:15:58
Message-ID: 824574.71366.qm@web65716.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)yahoo(dot)com> wrote:

> From: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
> Subject: Re: [GENERAL] Problem after installing triggering function
> To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> Cc: pgsql-general(at)postgresql(dot)org
> Date: Thursday, January 28, 2010, 8:53 AM
>
> Thanks and Regards
> Yan Cheng CHEOK
>
>
> --- On Thu, 1/28/10, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> wrote:
>
> > From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> > Subject: Re: [GENERAL] Problem after installing
> triggering function
> > To: "Yan Cheng Cheok" <yccheok(at)yahoo(dot)com>
> > Cc: pgsql-general(at)postgresql(dot)org
> > Date: Thursday, January 28, 2010, 12:34 AM
> > Yan Cheng Cheok <yccheok(at)yahoo(dot)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(at)postgresql(dot)org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-general
> >
>
>
>
>

Browse pgsql-general by date

  From Date Subject
Next Message Jim Mlodgenski 2010-01-28 01:22:52 Re: Amazon EC2 CPU Utilization
Previous Message Yan Cheng Cheok 2010-01-28 01:10:31 Re: Primary Key Increment Doesn't Seem Correct Under Table Partition