pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Glenn MacGregor <gtm@highstreetnetworks.com>
To: pgsql-admin@postgresql.org
Subject: delete cascade question
Date: Thu, 22 Apr 2004 15:49:42 -0400
Message-ID: <408821D6.2000106@highstreetnetworks.com> (raw)

Hi All,

I am using a cascade delete on the following table:

vid	vname		parentname
1	 n1@test.com			
2	 n2@test.com	     n1@test.com
3	 n3@test.com	     n1@test.com
4	 n4@test.com	     n1@test.com
5	 n5@test.com	     n3@test.com

So the delete cascade states if I am deleting a row whose vname matches 
the parentname delete those rows and it works fine.

I just changed the values of parentname (but the vname values stay the same)

vid	vname		parentname
1	 n1@test.com			
2	 n2@test.com	     n1
3	 n3@test.com	     n1
4	 n4@test.com	     n1
5	 n5@test.com	     n3

Is there a way to do the same cascade delete with these values? I can 
select the correct info from vname in a query:

select substring(vname, from 0 for position('@' in vname)) from table1;

This works, so I tried to put that in the cascade but it failed.

Is there any way to accomplish this?

	Thanks

		Glenn MacGregor





view thread (4+ messages)  latest in thread

Message-ID: <408821D6.2000106@highstreetnetworks.com>
Permalink:  ../408821D6.2000106@highstreetnetworks.com/
Also on:    postgresql.org/message-id/408821D6.2000106@highstreetnetworks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: gtm@highstreetnetworks.com
  Subject: Re: delete cascade question
  In-Reply-To: <408821D6.2000106@highstreetnetworks.com>
  References: <408821D6.2000106@highstreetnetworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox