Table rule does not work! - Mailing list pgsql-general

From omid omoomi
Subject Table rule does not work!
Date
Msg-id F2782UAaTzvb5YI9IJs00002185@hotmail.com
Whole thread Raw
Responses Re: Table rule does not work!
List pgsql-general
Hello all,
Here are two master/detail tables .
Table tk ( k1,k2,k3,k4,k5 ) and table tu (u1,u2,u3) where tk.k5 references
tu.u3  .
Now ,I've wrote a rule on table tk as below:
create rule tk_rule1 as on insert to tk do
update tu
set u1 = u1 + (new.k2 - new.k1) ,
    u2 = u2 + (new.k3 + new.k4 )
where tu.u3 = new.k5 ;

when I insert into table tk ,I expect to have table tu updated... but it is
not! although  there is no error message with it, the table tu remains
unchanged.

Any idea about what is wrong?
Is there any mistake with that rule or the 'new' variables?

TIA
Omid Omoomi



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


pgsql-general by date:

Previous
From: "Martin A. Marques"
Date:
Subject: pg_hba.conf file
Next
From: "Dan Harrington"
Date:
Subject: Error message on pg_dumpall