aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/twophase.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index ef4b5f639ce..28b153abc3c 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -1397,10 +1397,18 @@ XlogReadTwoPhaseData(XLogRecPtr lsn, char **buf, int *len)
record = XLogReadRecord(xlogreader, &errormsg);
if (record == NULL)
- ereport(ERROR,
- (errcode_for_file_access(),
- errmsg("could not read two-phase state from WAL at %X/%X",
- LSN_FORMAT_ARGS(lsn))));
+ {
+ if (errormsg)
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not read two-phase state from WAL at %X/%X: %s",
+ LSN_FORMAT_ARGS(lsn), errormsg)));
+ else
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not read two-phase state from WAL at %X/%X",
+ LSN_FORMAT_ARGS(lsn))));
+ }
if (XLogRecGetRmid(xlogreader) != RM_XACT_ID ||
(XLogRecGetInfo(xlogreader) & XLOG_XACT_OPMASK) != XLOG_XACT_PREPARE)