[HACKERS] triggers and inheritance tree

2012-03-28 Thread Jaime Casanova
Hi, i was trying to create triggers that redirect INSERT/UPDATE/DELETE actions from parent to childs, but found that UPDATE/DELETE doesn't get redirected. Actually, the triggers BEFORE UPDATE and BEFORE DELETE aren't even fired. I haven't tried with AFTER triggers to see if they are fired but i

Re: [HACKERS] triggers and inheritance tree

2012-03-28 Thread Jaime Casanova
On Wed, Mar 28, 2012 at 1:21 AM, Jaime Casanova ja...@2ndquadrant.com wrote: Hi, i was trying to create triggers that redirect INSERT/UPDATE/DELETE actions from parent to childs, but found that UPDATE/DELETE doesn't get redirected. Actually, the triggers BEFORE UPDATE and BEFORE DELETE

Re: [HACKERS] triggers and inheritance tree

2012-03-28 Thread Robert Haas
On Wed, Mar 28, 2012 at 9:16 AM, Jaime Casanova ja...@2ndquadrant.com wrote: On Wed, Mar 28, 2012 at 1:21 AM, Jaime Casanova ja...@2ndquadrant.com wrote: Hi, i was trying to create triggers that redirect INSERT/UPDATE/DELETE actions from parent to childs, but found that UPDATE/DELETE doesn't

Re: [HACKERS] triggers and inheritance tree

2012-03-28 Thread Jaime Casanova
On Wed, Mar 28, 2012 at 8:29 AM, Robert Haas robertmh...@gmail.com wrote: I think the problem is that the UPDATE or DELETE can only fire once a matching row has been identified, so that OLD can be filled in appropriately.  But in this case, the matching row gets found not in the parent table,

Re: [HACKERS] triggers and inheritance tree

2012-03-28 Thread Robert Haas
On Wed, Mar 28, 2012 at 10:46 AM, Jaime Casanova ja...@2ndquadrant.com wrote: On Wed, Mar 28, 2012 at 8:29 AM, Robert Haas robertmh...@gmail.com wrote: I think the problem is that the UPDATE or DELETE can only fire once a matching row has been identified, so that OLD can be filled in