Cascaded updates / deletes don't work on inherited tables

From: "Michael Barber" <mbarber(at)netraver(dot)org(dot)za>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Cascaded updates / deletes don't work on inherited tables
Date: 2002-05-06 18:14:14
Message-ID: 000501c1f529$d723b3b0$0100000a@michael
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

If I create a table with a primary key and then I reference that column
from another table, the cascaded updates and deletes work without any
problem.

However, if I then create a table that inherits the previous one, the
cascaded deletes and updates only affect the original (parent) table --
the records in the new (child) table remain unaffected.
To be honest, I really don't know all that much about SQL standards, but I
would have thought that since just about all the characteristics of the parent
table are inherited, then surely the triggers would be as well.

If I create a table with a primary key and then I reference that column
from another table, the cascaded updates and deletes work without any
problem.

However, if I then create a table that inherits the previous one, the
cascaded deletes and updates only affect the original (parent) table --
the records in the new (child) table remain unaffected.

To be honest, I really don't know all that much about SQL standards, but I
would have thought that since just about all the characteristics of the parent
table are inherited, then surely the triggers would be as well.

Apart from that, I'm not too sure how to perform the cascaded deletes or
updates with a SQL instruction, so if someone could help me with that,
I'd really appreciate it. There must be a 'standard' way to do it ;-)

Michael S. Barber
|
| mbarber(at)netraver(dot)org(dot)za
| ICQ 3233720
| +27 (0)11 7875110 (landline)
| +27 (0)83 2260428 (cellular)

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Wendy Powley 2002-05-06 18:39:34 Stored Procedures
Previous Message Bruno Wolff III 2002-05-06 16:22:46 Re: search and replace possible on SQL?