Skip to content

Commit 22cc3b3

Browse files
committed
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.
1 parent b72bd3d commit 22cc3b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/error/elog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
19701970
}
19711971
break;
19721972
case 'c':
1973-
appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
1973+
appendStringInfo(buf, "%lx.%04x", (long) (MyStartTime), MyProcPid);
19741974
break;
19751975
case 'p':
19761976
appendStringInfo(buf, "%d", MyProcPid);
@@ -2149,7 +2149,7 @@ write_csvlog(ErrorData *edata)
21492149
appendStringInfoChar(&buf, ',');
21502150

21512151
/* session id */
2152-
appendStringInfo(&buf, "%lx.%x", (long) MyStartTime, MyProcPid);
2152+
appendStringInfo(&buf, "%lx.%04x", (long) MyStartTime, MyProcPid);
21532153
appendStringInfoChar(&buf, ',');
21542154

21552155
/* Line number */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy