Re: Do we want to enable foreign key constraints on subscriber?

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Do we want to enable foreign key constraints on subscriber?
Дата
Msg-id CAA4eK1+Ckw3gaEPuZa+mCwNBV1wK6LMFSQYjdVOPcuT=S1-QJA@mail.gmail.com
обсуждение исходный текст
Ответ на Do we want to enable foreign key constraints on subscriber?  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
On Wed, Jul 19, 2023 at 12:21 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> There's an issue brought up in the -bugs list [1]. Since triggers are
> deactivated on a subscriber by default, foreign key constraints don't
> fire for replicated changes. The docs state this is done to prevent
> repetitive data propagation between tables on subscribers. But foreign
> key triggers don't contribute to this issue.
>

Right and recent reports indicate that this does cause inconvenience for users.

> My understanding is that constraint triggers, including ones created
> using the "CREATE CONSTRAINT TRIGGER" command, aren't spposed to alter
> data.
>

I also think so. You need to update the docs for this.

Peter E., do you remember if there is any specific problem in enabling
such triggers by default for apply side? The only thing that I can
think of is that the current behavior keeps the trigger-firing rules
the same for all kinds of triggers which has merits but OTOH it causes
inconvenience to users, especially for foreign-key checks.

--
With Regards,
Amit Kapila.



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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Row pattern recognition
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Report distinct wait events when waiting for WAL "operation"