Re: [NOVICE] protected ON DELETE CASCADE

Поиск
Список
Период
Сортировка
От Albert Reiner
Тема Re: [NOVICE] protected ON DELETE CASCADE
Дата
Msg-id Pine.HPX.4.10.10108231409210.15991-100000@stud3.tuwien.ac.at
обсуждение исходный текст
Ответ на protected ON DELETE CASCADE  (Murray Hobbs <murray@efone.com>)
Список pgsql-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.



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Marcia Cunha"
Дата:
Сообщение: Sql
Следующее
От: "Vladimir Terziev"
Дата:
Сообщение: Problem with sequences