Re: [PATCH] Partial foreign key updates in referential integrity triggers

Поиск
Список
Период
Сортировка
От Paul Martinez
Тема Re: [PATCH] Partial foreign key updates in referential integrity triggers
Дата
Msg-id CAF+2_SFTfdOK+bXuoCvvhJxLbRwtmZdPy5R6dAu7h=E6Hbu-6w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Partial foreign key updates in referential integrity triggers  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: [PATCH] Partial foreign key updates in referential integrity triggers  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On Mon, Nov 22, 2021 at 10:21 PM Zhihong Yu <zyu@yugabyte.com> wrote:
>
> Hi,
> +       If a foreign key with a <literal>SET NULL</literal> or <literal>SET
> +       DEFAULT</literal> delete action, which columns should be updated.
>
> which columns should be updated -> the columns that should be updated

Done.

> +   if (fk_del_set_cols)
> +   {
> +       int num_delete_cols = 0;
>
> Since num_delete_cols is only used in the else block, I think it can be moved inside else block.
> Or you can store the value inside *num_fk_del_set_cols directly and avoid num_delete_cols.

I've moved it inside the else block (and removed the initialization).

Updated patch attached. Thanks for taking a look so quickly!

- Paul

Вложения

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

Предыдущее
От: Zhihong Yu
Дата:
Сообщение: Re: [PATCH] Partial foreign key updates in referential integrity triggers
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Sequence's value can be rollback after a crashed recovery.