Re: FW: BUG in trigger and foreign keys

Поиск
Список
Период
Сортировка
От Jefim Matskin
Тема Re: FW: BUG in trigger and foreign keys
Дата
Msg-id A27FEC8516051048B5B3A119BC0D8CB65B1ABA@exch2k.spheranet.com
обсуждение исходный текст
Ответ на FW: BUG in trigger and foreign keys  ("Jefim Matskin" <JefimM@sphera.com>)
Ответы Re: FW: BUG in trigger and foreign keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Thank you for pointing that out. It seems that "oops I did it again".

What are the rules for the order of the invocation  of triggers defined for some table?
If several triggers are defined which one if executed first?

Jefim

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Wed 25 December 2002 6:08
To: Jefim Matskin
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] FW: BUG in trigger and foreign keys


"Jefim Matskin" <JefimM@sphera.com> writes:
> If try it with the same  script - but without the constraints - you will see the difference.
> And there should not be any since the data is the same in the tables.

No, it's not the same.  Consider the implications of the constraint
you added:

ALTER TABLE reseller ADD CONSTRAINT FK_reseller_parent
FOREIGN KEY (parent_id) REFERENCES reseller(reseller_id)
ON DELETE CASCADE ON UPDATE CASCADE;
^^^^^^^^^^^^^^^^^

This will cause the delete of reseller_id 1338 to propagate to the rows
in which 1338 appears as parent_id.  Which sure looks to me like it's
the behavior you're complaining of.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: FW: BUG in trigger and foreign keys
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Multiple Foreign Keys to same table and field