Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY
Shlok Kyal <shlok.kyal.oss@gmail.com>
From: Shlok Kyal <shlok.kyal.oss@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Amit Kapila <amit.kapila16@gmail.com>
Date: 2024-11-18T19:06:25Z
Lists: pgsql-hackers
Attachments
- v8-0001-Disallow-UPDATE-DELETE-on-table-with-generated-co.patch (application/octet-stream) patch v8-0001
On Mon, 18 Nov 2024 at 19:19, vignesh C <vignesh21@gmail.com> wrote: > > 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? > Yes, we can add this check. > 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] Fixed I have fixed the comments and attached an updated patch. Thanks and Regards, Shlok Kyal
Commits
-
Improve the error message introduced in commit 87ce27de696.
- 2d0152d6147b 18.0 landed
-
Ensure stored generated columns must be published when required.
- 87ce27de6963 18.0 landed
-
Replicate generated columns when 'publish_generated_columns' is set.
- 7054186c4ebe 18.0 cited
-
Ignore generated columns during apply of update/delete.
- adedf54e659e 16.0 cited
-
Ignore dropped columns during apply of update/delete.
- b797def5951f 16.0 cited