Skip site navigation (1) Skip section navigation (2)

Re: [NOVICE] protected ON DELETE CASCADE

From: Albert Reiner <e8901869(at)student(dot)tuwien(dot)ac(dot)at>
To: Murray Hobbs <murray(at)efone(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [NOVICE] protected ON DELETE CASCADE
Date: 2001-08-23 12:12:32
Message-ID: Pine.HPX.4.10.10108231409210.15991-100000@stud3.tuwien.ac.at (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novicepgsql-sql
On Thu, 23 Aug 2001, Murray Hobbs wrote:

> A <- B
> A <- C <- D
> 
> i want to maintain integrity so that if A is deleted from then so is
> anything referencing from B and C - no problem ON DELETE CASCADE
> 
> but if there are any D's that point back to A (through composite key in
> C) i don't want the delete to go ahead - at all - i want an error
> message and condition

what about ON DELETE RESTRICT there?

> I've looked at TRIGGER but then i'm writing a function (in SQL?) which
> is called by a trigger - again - how do i confirm or reject a delete?

Look at the docs: there is a difference between DO and DO INSTEAD (I
think, I am no expert on Pg, and I do not have access to a Pg system right
now).

Albert.



In response to

pgsql-novice by date

Next:From: Oliver ElphickDate: 2001-08-23 12:28:47
Subject: Re: integrity and inherit
Previous:From: Bo LorentsenDate: 2001-08-23 10:20:03
Subject: integrity and inherit

pgsql-general by date

Next:From: Gilles DAROLDDate: 2001-08-23 12:35:47
Subject: Re: Postgresql log analyzer
Previous:From: Ben-Nes MichaelDate: 2001-08-23 11:46:47
Subject: store in bytea

pgsql-sql by date

Next:From: Jan WieckDate: 2001-08-23 13:55:37
Subject: Re: protected ON DELETE CASCADE
Previous:From: JaydipDate: 2001-08-23 07:50:52
Subject: Help On Postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group