Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2d0152d

Browse files
author
Amit Kapila
committed
Improve the error message introduced in commit87ce27d.
The error detail message "Replica identity consists of an unpublishedgenerated column." implies that the entire replica identity is made up ofan unpublished generated column which may not be the case.Reported-by: Peter SmithAuthor: Shlok KyalReviewed-by: Peter Smith, Amit KapilaDiscussion:https://postgr.es/m/CAHut+PuwMhKx0PhOA4APhJTLoBGNykbeCQpr_CuwGT-SkswG5w@mail.gmail.com
1 parentda99fed commit2d0152d

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 identityconsists of an unpublished generatedcolumn.")));
828+
errdetail("Replica identitymust not contain unpublished generatedcolumns.")));
829829
elseif (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 identityconsists of an unpublished generatedcolumn.")));
846+
errdetail("Replica identitymust not contain unpublished generatedcolumns.")));
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 identityconsists of an unpublished generatedcolumn.
686+
DETAIL: Replica identitymust not contain unpublished generatedcolumns.
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 identityconsists of an unpublished generatedcolumn.
692+
DETAIL: Replica identitymust not contain unpublished generatedcolumns.
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)

[8]ページ先頭

©2009-2025 Movatter.jp