Re: triggers and FK cascades

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: triggers and FK cascades
Дата
Msg-id 001601cbe4ff$a0d5a320$e280e960$@yahoo.com
обсуждение исходный текст
Ответ на triggers and FK cascades  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Ответы Re: triggers and FK cascades  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Список pgsql-general
Don't know if this would work but could you check to see if the corresponding PK exists on A?

It may also help to explain why you would want to do such a thing so that someone may be able to provide an alternative
solutionas opposed to simply responding to a generic feature question. 

David J.

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Grzegorz Jaskiewicz
Sent: Thursday, March 17, 2011 6:41 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] triggers and FK cascades

Considering the following example.
Tables A and B.
Table A contains some data.
Table B reefers to table A using FK with 'on delete cascade'. Table B has a trigger on it, after delete per row

Now, is there any way I can tell in the trigger on table B that it has been called from a direct delete on that table,
asoppose to the indirect (FK) delete on table A? 

Trigger is PLpg/SQL or C function.


--
GJ

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


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

Предыдущее
От: "MauMau"
Дата:
Сообщение: Re: Is PostgreSQL supported on RHEL6?
Следующее
От: bubba postgres
Дата:
Сообщение: why does extract ( HOUR FROM TIMESTAMP '2010-01-01 00:00:00' at time zone 'utc' ) == 16?