Re: delete cascade question - Mailing list pgsql-admin

From Stephan Szabo
Subject Re: delete cascade question
Date
Msg-id 20040427065413.T35713@megazone.bigpanda.com
Whole thread Raw
In response to Re: delete cascade question  (Glenn MacGregor <gtm@highstreetnetworks.com>)
List pgsql-admin
On Tue, 27 Apr 2004, Glenn MacGregor wrote:

> Now I need to change the parentname field (in the case of vimid = 2)
> from test@test.com to test and keep the vimname field as is. When I do
> this the constraint no longer works (which makes perfect sense).
>
> 1 | test@test.com | cell | f | cell@test.com | cell | test.xml |
> 192.168.0.23 | | 1 | t | group1
>
> 2 | test@test.com_if_1 | cell | f | cell@test.com | cell | test_if.xml |
> 192.168.0.23 | test | 2 | t | group1
>
> delete row 1 and row 2 stays around.
>
> Is there a way to create a constraint that will delete row 2 if I delete
> row 1 using a substring of the vimname to match with the parentname?

AFAIK only by writing your own trigger.  You could possibly get away with
using the foreign key trigger code as a starting point.


pgsql-admin by date:

Previous
From: Glenn MacGregor
Date:
Subject: Re: delete cascade question
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: [JDBC] [PERFORM] is a good practice to create an index on the