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.