diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c index c5d85eced48..94f2eaa2346 100644 --- a/src/backend/commands/repack.c +++ b/src/backend/commands/repack.c @@ -2581,7 +2581,7 @@ apply_concurrent_changes(BufFile *file, ChangeContext *chgcxt) /* Find the tuple to be deleted */ found = find_target_tuple(rel, chgcxt, spilled_tuple, ondisk_tuple); if (!found) - elog(ERROR, "failed to find target tuple"); + elog(ERROR, "could not find target tuple"); apply_concurrent_delete(rel, ondisk_tuple); } else if (kind == CHANGE_UPDATE_NEW) @@ -2597,7 +2597,7 @@ apply_concurrent_changes(BufFile *file, ChangeContext *chgcxt) /* Find the tuple to be updated or deleted. */ found = find_target_tuple(rel, chgcxt, key, ondisk_tuple); if (!found) - elog(ERROR, "failed to find target tuple"); + elog(ERROR, "could not find target tuple"); /* * If 'tup' contains TOAST pointers, they point to the old @@ -2674,7 +2674,9 @@ apply_concurrent_update(Relation rel, TupleTableSlot *spilled_tuple, &tmfd, &lockmode, &update_indexes); if (res != TM_Ok) ereport(ERROR, - errmsg("failed to apply concurrent UPDATE")); + errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), + errmsg("could not apply concurrent %s on relation \"%s\"", + "UPDATE", RelationGetRelationName(rel))); if (update_indexes != TU_None) { @@ -2710,7 +2712,9 @@ apply_concurrent_delete(Relation rel, TupleTableSlot *slot) if (res != TM_Ok) ereport(ERROR, - errmsg("failed to apply concurrent DELETE")); + errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), + errmsg("could not apply concurrent %s on relation \"%s\"", + "DELETE", RelationGetRelationName(rel))); pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1); } @@ -3005,7 +3009,7 @@ initialize_change_context(ChangeContext *chgcxt, } } if (chgcxt->cc_ident_index == NULL) - elog(ERROR, "failed to find identity index"); + elog(ERROR, "could not find identity index"); /* Set up for scanning said identity index */ { diff --git a/src/backend/commands/repack_worker.c b/src/backend/commands/repack_worker.c index 4f82eb46bec..ddf070eae07 100644 --- a/src/backend/commands/repack_worker.c +++ b/src/backend/commands/repack_worker.c @@ -432,6 +432,7 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, priv->end_of_wal = false; else ereport(ERROR, + errcode(ERRCODE_DATA_CORRUPTED), errmsg("could not read WAL record")); } @@ -479,6 +480,7 @@ decode_concurrent_changes(LogicalDecodingContext *ctx, if (res != WAIT_LSN_RESULT_SUCCESS && res != WAIT_LSN_RESULT_TIMEOUT) ereport(ERROR, + errcode(ERRCODE_INTERNAL_ERROR), errmsg("waiting for WAL failed")); } }