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

Zhihong Yu <zyu@yugabyte.com>

From: Zhihong Yu <zyu@yugabyte.com>
To: Paul Martinez <hellopfm@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>, Ibrar Ahmed <ibrar.ahmad@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2021-09-02T20:54:52Z
Lists: pgsql-hackers
On Thu, Sep 2, 2021 at 12:11 PM Paul Martinez <hellopfm@gmail.com> wrote:

> On Wed, Sep 1, 2021 at 4:11 AM Daniel Gustafsson <daniel@yesql.se> wrote:
>
> > This patch no longer applies, can you please submit a rebased version?
> It
> > currently fails on catversion.h, to keep that from happening repeatedly
> you can
> > IMO skip that from the patch submission.
>
> Ah, understood. Will do that in the future. Attached are rebased patches,
> not
> including catversion.h changes, for both the ON UPDATE/DELETE case, and the
> ON DELETE only case.
>
> - Paul
>
Hi,
+       case RI_TRIGTYPE_DELETE:
+           queryno = is_set_null
+               ? RI_PLAN_ONDELETE_SETNULL_DOUPDATE
+               : RI_PLAN_ONDELETE_SETDEFAULT_DOUPDATE;

Should the new symbols be renamed ?

RI_PLAN_ONDELETE_SETNULL_DOUPDATE -> RI_PLAN_ONDELETE_SETNULL_DODELETE
RI_PLAN_ONDELETE_SETDEFAULT_DOUPDATE -> RI_PLAN_ONDELETE_SETDEFAULT_DODELETE

Cheers

Commits

  1. Allow specifying column list for foreign key ON DELETE SET actions

  2. doc: Add referential actions to CREATE/ALTER TABLE synopsis