Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY - Mailing list pgsql-hackers

From vignesh C
Subject Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY
Date
Msg-id CALDaNm21o82etf0H+AX_FSs3F2s51Bdgh6OSYoUaL6AESxrduQ@mail.gmail.com
Whole thread Raw
In response to Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Mon, 18 Nov 2024 at 13:07, Shlok Kyal <shlok.kyal.oss@gmail.com> wrote:
>
> Thanks for providing the comments.
>
> On Sat, 16 Nov 2024 at 17:29, vignesh C <vignesh21@gmail.com> wrote:
>
> I have attached the updated version of the patch.

Few comments:
1) We have the following check for cols validation and rf validation:
    /*
     * If we know everything is replicated and the column list is invalid
     * for update and delete, there is no point to check for other
     * publications.
     */
    if (pubdesc->pubactions.pubinsert && pubdesc->pubactions.pubupdate &&
      pubdesc->pubactions.pubdelete && pubdesc->pubactions.pubtruncate &&
      !pubdesc->cols_valid_for_update && !pubdesc->cols_valid_for_delete)
      break;

Should we do this for replident_valid_for_update and
replident_valid_for_delete also?

2) This variable is not required, there is a warning:
publicationcmds.c: In function ‘replident_has_unpublished_gen_col’:
publicationcmds.c:486:41: warning: unused variable ‘x’ [-Wunused-variable]

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Ilia Evdokimov
Date:
Subject: Re: Showing applied extended statistics in explain Part 2
Next
From: Peter Eisentraut
Date:
Subject: Re: NOT ENFORCED constraint feature