Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Shlok Kyal <shlok.kyal.oss@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>,
"Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-11-28T11:07:59Z
Lists: pgsql-hackers
On Thu, Nov 21, 2024 at 5:30 PM Shlok Kyal <shlok.kyal.oss@gmail.com> wrote: > Review comments: =============== 1. + + /* + * true if all generated columns which are part of replica identity are + * published or the publication actions do not include UPDATE or DELETE. + */ + bool replident_valid_for_update; + bool replident_valid_for_delete; These are too generic names for the purpose they are used. How about instead name them as gencols_valid_for_update and gencols_valid_for_delete? 2. The comments atop RelationBuildPublicationDesc() is only about row filter. We should update it for column list and generated columns as well. 3. It is better to merge the functionality of the invalid column list and unpublished generated columns as proposed by Hou-San above. -- With Regards, Amit Kapila.
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