Re: TRIGGER BEFORE INSERT

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: TRIGGER BEFORE INSERT
Дата
Msg-id 28753.1168543671@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: TRIGGER BEFORE INSERT  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> On Thu, Jan 11, 2007 at 07:26:32PM +0100, Rafal Pietrak wrote:
>> So may be "SET CONSTRAINTS  .... DEFERRED " should be used somehow
>> differently? I've never had any use for that construct, may be I miss
>> something?

> Only at the beginning of a transaction and it only works on foreign
> keys marked deferrable.

No, you can do it mid-transaction.  I think the problem is the second
part: the FK constraint has to be marked deferrable, which is not the
default I believe.  Also, you could forget the SET CONSTRAINTS entirely
if you made the constraint INITIALLY DEFERRED ... then it'd always act
as a deferred check.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ORDER BY col is NULL in UNION causes error?
Следующее
От: Jonathan Hedstrom
Дата:
Сообщение: Re: ERROR: invalid memory alloc request size, and others