[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

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 sramazz...@gmail.comwrote: 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 (

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

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

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

2010-03-23 Thread Sergio Ramazzina
] Before triggers and usage in partitioned tables To: Albe Laurenz laurenz.a...@wien.gv.at Albe, I attached the complete ddl. I hope this will help you in the investigation. My Postgres server is 8.1.1. I tried also using rules instead of trigger but the behavior is the same. I haven't had the time

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

2010-03-23 Thread Tom Lane
Sergio Ramazzina sramazz...@gmail.com 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