git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da99fed)
Improve the error message introduced in commit 87ce27de696.
Mon, 9 Dec 2024 03:41:45 +0000 (09:11 +0530)
Mon, 9 Dec 2024 03:41:45 +0000 (09:11 +0530)
The error detail message "Replica identity consists of an unpublished
generated column." implies that the entire replica identity is made up of
an unpublished generated column which may not be the case.

Reported-by: Peter Smith
Author: Shlok Kyal
Reviewed-by: Peter Smith, Amit Kapila
Discussion: https://postgr.es/m/CAHut+PuwMhKx0PhOA4APhJTLoBGNykbeCQpr_CuwGT-SkswG5w@mail.gmail.com


diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c
index cfdf2eedf4de066c76ce504c9e209e7bee4b5072..368a40337aa5b55e07bc990d0c38ddfcb3f34d90 100644 (file)
--- a/src/backend/executor/execReplication.c
+++ b/src/backend/executor/execReplication.c
@@ -825,7 +825,7 @@ CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
errmsg("cannot update table \"%s\"",
RelationGetRelationName(rel)),
- errdetail("Replica identity consists of an unpublished generated column.")));
+ errdetail("Replica identity must not contain unpublished generated columns.")));
else if (cmd == CMD_DELETE && !pubdesc.rf_valid_for_delete)
ereport(ERROR,
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
@@ -843,7 +843,7 @@ CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
errmsg("cannot delete from table \"%s\"",
RelationGetRelationName(rel)),
- errdetail("Replica identity consists of an unpublished generated column.")));
+ errdetail("Replica identity must not contain unpublished generated columns.")));
/* If relation has replica identity we are always good. */
if (OidIsValid(RelationGetReplicaIndex(rel)))
diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out
index b44ab007de6e2f1fa6db5c544594d62a2e1e86f7..c48f11f2935180fc78ea44861eab3f2a128f9676 100644 (file)
--- a/src/test/regress/expected/publication.out
+++ b/src/test/regress/expected/publication.out
@@ -683,13 +683,13 @@ ALTER TABLE testpub_gencol REPLICA IDENTITY USING index testpub_gencol_idx;
CREATE PUBLICATION pub_gencol FOR TABLE testpub_gencol;
UPDATE testpub_gencol SET a = 100 WHERE a = 1;
ERROR: cannot update table "testpub_gencol"
-DETAIL: Replica identity consists of an unpublished generated column.
+DETAIL: Replica identity must not contain unpublished generated columns.
-- error - generated column "b" must be published explicitly as it is
-- part of the REPLICA IDENTITY.
ALTER TABLE testpub_gencol REPLICA IDENTITY FULL;
UPDATE testpub_gencol SET a = 100 WHERE a = 1;
ERROR: cannot update table "testpub_gencol"
-DETAIL: Replica identity consists of an unpublished generated column.
+DETAIL: Replica identity must not contain unpublished generated columns.
DROP PUBLICATION pub_gencol;
-- ok - generated column "b" is published explicitly
CREATE PUBLICATION pub_gencol FOR TABLE testpub_gencol with (publish_generated_columns = true);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /