Re: Deferred foreign key constraint downsides

Поиск
Список
Период
Сортировка
От Jerry Sievers
Тема Re: Deferred foreign key constraint downsides
Дата
Msg-id 87zko01q7g.fsf@comcast.net
обсуждение исходный текст
Ответ на Deferred foreign key constraint downsides  (Jack Christensen <jackc@hylesanderson.edu>)
Список pgsql-general
Jack Christensen <jackc@hylesanderson.edu> writes:

> I recently had cause to use a deferred foreign key constraint for the
> first time. I like it. It seems it could make life simpler, especially
> when an obstinate ORM insists on doing things in the wrong order.
>
> The only downside I can see is it may be harder to track down where a
> violation occurred since the error won't be raised until commit.
>
> Are there any other downsides to just setting all my foreign keys to
> initially deferred?

I'd say, use the feature only as needed.  Gratuitous deviation from
reasonable default should be avoided.

Why promote being able to insert rows in related tables using other than
top-down sequencing?

Sure, if you have an existing app that does that, which you can't
change, go with deferred validation, otherwise no.

YMMV

> Thanks.
>
> --
> Jack Christensen
> jackc@hylesanderson.edu

--
Jerry Sievers
e: gsievers19@comcast.net
p: 305.321.1144

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

Предыдущее
От: Jason Long
Дата:
Сообщение: Re: comma vs cross join question
Следующее
От: Carlos Mennens
Дата:
Сообщение: Re: Changed SSL Certificates