From 22cc3b35f4d614aff83606a443da475215c6dd84 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 16 Oct 2012 12:37:59 -0400 Subject: [PATCH] When outputting the session id in log_line_prefix (%c) or in CSV log output mode, cause the hex digits after the period to always be at least four hex digits, with zero-padding. --- src/backend/utils/error/elog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index a40b343ebcf..68b7ab3f5fb 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -1970,7 +1970,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) } break; case 'c': - appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid); + appendStringInfo(buf, "%lx.%04x", (long) (MyStartTime), MyProcPid); break; case 'p': appendStringInfo(buf, "%d", MyProcPid); @@ -2149,7 +2149,7 @@ write_csvlog(ErrorData *edata) appendStringInfoChar(&buf, ','); /* session id */ - appendStringInfo(&buf, "%lx.%x", (long) MyStartTime, MyProcPid); + appendStringInfo(&buf, "%lx.%04x", (long) MyStartTime, MyProcPid); appendStringInfoChar(&buf, ','); /* Line number */ -- 2.39.5