Re: PostgreSQL 7.4.2 allows foreign key violation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL 7.4.2 allows foreign key violation
Дата
Msg-id 20097.1091809543@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PostgreSQL 7.4.2 allows foreign key violation  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: PostgreSQL 7.4.2 allows foreign key violation  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> It also looks like before triggers returning NULL can break them.

Or a BEFORE trigger that overrides the attempted field update.

> I think we'd been worried about the added cost of doing the check when
> the average case doesn't have this problem but we should probably just
> eat it.  In practice I think it's one line of code per action function
> (on update set default already does it).

Already does what?  I see nothing in there that would override either
triggers or rules...

> Any opinions out there?

I seem to recall some discussions to the effect that having these
updates subject to rules/triggers is not necessarily bad.  For example,
if you were using a rule or trigger to log all updates of table B
someplace else, you'd probably be annoyed to find the RI updates
bypassing your logging mechanism.

There's no perfect solution ...

            regards, tom lane

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

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: PG over NFS tips
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: PostgreSQL 7.4.2 allows foreign key violation