Table rule does not work!

From: "omid omoomi" <oomoomi(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Table rule does not work!
Date: 2001-03-02 22:45:06
Message-ID: F2782UAaTzvb5YI9IJs00002185@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan Harrington 2001-03-02 23:12:24 Error message on pg_dumpall
Previous Message Martin A. Marques 2001-03-02 22:23:51 pg_hba.conf file