Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Shlok Kyal <shlok.kyal.oss@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
vignesh C <vignesh21@gmail.com>
Date: 2024-12-05T02:03:50Z
Lists: pgsql-hackers
Hi,
I was looking at the recently pushed code [1]. IMO the wording of some
of those new error messages of function CheckCmdReplicaIdentity() is
not quite correct.
According to my understanding, and according also to Chat-GPT:
------
The sentence "Replica identity consists of an unpublished generated
column." implies that the entire replica identity is made up of an
unpublished generated column and nothing else.
This is because the phrase "consists of" typically indicates a
complete composition, meaning that the replica identity is exclusively
composed of the unpublished generated column in this context.
------
IIUC, these errors are intended for when there is *any* unpublished
generated column found in the RI, and the RI might also have other
columns in it generated or otherwise. So, I think those error messages
saying "consists of" should be reworded like below, or similar:
* errdetail("Replica identity includes an unpublished generated column.")));
* errdetail("Replica identity has one or more unpublished generated
columns.")));
* errdetail("One or more unpublished generated columns are in the
Replica identity.")));
* ...
======
[]1 https://github.com/postgres/postgres/commit/87ce27de6963091f4a365f80bcdb06b9da098f00
Kind Regards,
Peter Smith.
Fujitsu Australia
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