diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-08-01 11:05:08 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-08-01 11:15:26 +0200 |
commit | fd6ec93bf890314ac694dc8a7f3c45702ecc1bbd (patch) | |
tree | d1f9d8fca804355b7290c43573a109dc7a8c1a74 /src/backend/access/heap/heapam_handler.c | |
parent | b2a3d706b8d76b9d65e953942fc1ccafe892f692 (diff) | |
download | postgresql-fd6ec93bf890314ac694dc8a7f3c45702ecc1bbd.tar.gz postgresql-fd6ec93bf890314ac694dc8a7f3c45702ecc1bbd.zip |
Add error codes to some corruption log messages
In some cases we have elog(ERROR) while corruption is certain and we
can give a clear error code ERRCODE_DATA_CORRUPTED or
ERRCODE_INDEX_CORRUPTED.
Author: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://www.postgresql.org/message-id/flat/25F6C686-6442-4A6B-BAF8-A6F7B84B16DE@yandex-team.ru
Diffstat (limited to 'src/backend/access/heap/heapam_handler.c')
-rw-r--r-- | src/backend/access/heap/heapam_handler.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 09bc6fe98a7..f1ff01e8cb9 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -423,7 +423,9 @@ tuple_lock_retry: /* otherwise xmin should not be dirty... */ if (TransactionIdIsValid(SnapshotDirty.xmin)) - elog(ERROR, "t_xmin is uncommitted in tuple to be updated"); + ereport(ERROR, + (errcode(ERRCODE_DATA_CORRUPTED), + errmsg_internal("t_xmin is uncommitted in tuple to be updated"))); /* * If tuple is being updated by other transaction then we |