Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2d0152d

Browse files
author
Amit Kapila
committed
Improve the error message introduced in commit 87ce27d.
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
1 parent da99fed commit 2d0152d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/executor/execReplication.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
825825
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
826826
errmsg("cannot update table \"%s\"",
827827
RelationGetRelationName(rel)),
828-
errdetail("Replica identity consists of an unpublished generated column.")));
828+
errdetail("Replica identity must not contain unpublished generated columns.")));
829829
else if (cmd == CMD_DELETE && !pubdesc.rf_valid_for_delete)
830830
ereport(ERROR,
831831
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
@@ -843,7 +843,7 @@ CheckCmdReplicaIdentity(Relation rel, CmdType cmd)
843843
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
844844
errmsg("cannot delete from table \"%s\"",
845845
RelationGetRelationName(rel)),
846-
errdetail("Replica identity consists of an unpublished generated column.")));
846+
errdetail("Replica identity must not contain unpublished generated columns.")));
847847

848848
/* If relation has replica identity we are always good. */
849849
if (OidIsValid(RelationGetReplicaIndex(rel)))

src/test/regress/expected/publication.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,13 +683,13 @@ ALTER TABLE testpub_gencol REPLICA IDENTITY USING index testpub_gencol_idx;
683683
CREATE PUBLICATION pub_gencol FOR TABLE testpub_gencol;
684684
UPDATE testpub_gencol SET a = 100 WHERE a = 1;
685685
ERROR: cannot update table "testpub_gencol"
686-
DETAIL: Replica identity consists of an unpublished generated column.
686+
DETAIL: Replica identity must not contain unpublished generated columns.
687687
-- error - generated column "b" must be published explicitly as it is
688688
-- part of the REPLICA IDENTITY.
689689
ALTER TABLE testpub_gencol REPLICA IDENTITY FULL;
690690
UPDATE testpub_gencol SET a = 100 WHERE a = 1;
691691
ERROR: cannot update table "testpub_gencol"
692-
DETAIL: Replica identity consists of an unpublished generated column.
692+
DETAIL: Replica identity must not contain unpublished generated columns.
693693
DROP PUBLICATION pub_gencol;
694694
-- ok - generated column "b" is published explicitly
695695
CREATE PUBLICATION pub_gencol FOR TABLE testpub_gencol with (publish_generated_columns = true);

0 commit comments

Comments
 (0)