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

2010-03-23 Thread Tom Lane
Sergio Ramazzina writes: > [ test case ] It seems to work as expected for me: regression=# insert into tpm_wind_dcn values ('r','i','2010-01-09',42); INSERT 0 0 regression=# select * from tpm_wind_dcn; router | interface |data| qora | m1 | m2 | m3 | m4 | m5 | m6 +---+--

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

2010-03-23 Thread Sergio Ramazzina
Sorry but I mistakenly replied only to Albe. Repost it to the list. Apologize me but also the server version is not correct is 8.1.11 (I forget the last 1). Regards S -- Forwarded message -- From: Sergio Ramazzina Date: 2010/3/23 Subject: Re: [GENERAL] Before triggers and usage

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

[GENERAL] Before triggers and usage in partitioned tables

2010-03-23 Thread Sergio Ramazzina
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.postgresql.org/docs/8.4/interactive/ddl-partitioning.html) and I've a p