Re: DEFERRABLE NOT NULL constraint

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: DEFERRABLE NOT NULL constraint
Дата
Msg-id keqn11$dio$1@ger.gmane.org
обсуждение исходный текст
Ответ на Re: DEFERRABLE NOT NULL constraint  (Andreas Joseph Krogh <andreak@officenet.no>)
Список pgsql-general
Andreas Joseph Krogh, 05.02.2013 11:15:
>     Andreas Joseph Krogh, 05.02.2013 10:57:
>      > The value of having NOT NULL deferrable is, well, to not check for
>      > NULL until the tx commits. When working with ORMs this often is the
>      > case, especially with circular FKs.
>
>     With circular FKs it's enough to define the FK constraint as deferred.
>
> I meant; circular FKs which are also NOT NULL

A deferrable FK is still enough for that scenario as you can insert FK values that do not yet exist.

See Alban's answer for an example.

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: DEFERRABLE NOT NULL constraint
Следующее
От: Hari Babu
Дата:
Сообщение: Re: Hot Standby has PANIC: WAL contains references to invalid pages