Re: [GENERAL] Before triggers and usage in partitioned tables

2010-03-23 Thread Albe Laurenz
Sergio Ramazzina wrote: > I'm new to postgresql and I need some help to understand the > behaviour of before insert triggers in postgresql. I'm trying the sample > documented in the user manual about implementing table partitions > (http://www.postgresql.org/docs/8.4/interactive/ddl-partitioning.

Re: [GENERAL] Before triggers and usage in partitioned tables

2010-03-23 Thread Sergio Ramazzina
Hi Scott, here's the trigger and the function CREATE OR REPLACE FUNCTION tpm_wind_dcn_insert_trigger() RETURNS TRIGGER AS $$ BEGIN IF ( NEW.data >= DATE '2010-01-01' AND NEW.data < DATE '2010-01-02' ) THEN INSERT INTO tp_wind_dcn_day1 VALUES (NEW.*); ELSIF ( NEW.data >= DATE '2010

Re: [GENERAL] Before triggers and usage in partitioned tables

2010-03-23 Thread Scott Mead
On Tue, Mar 23, 2010 at 4:23 AM, Sergio Ramazzina wrote: > Hi everybody, > > I'm new to postgresql and I need some help to understand the behaviour of > before insert triggers in postgresql. I'm trying the sample > documented in the user manual about implementing table partitions ( > http://www.po