Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b06e6a

Browse files
committed
Revert idea of zer-padding padding session id in log_line_prefix
Removal of doc adjustment and release note mention as well.
1 parent539ecc9 commit8b06e6a

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4089,14 +4089,14 @@ local0.* /var/log/postgresql
40894089
</informaltable>
40904090

40914091
The <literal>%c</> escape prints a quasi-unique session identifier,
4092-
consisting of two 4-byte hexadecimal numbersseparated by a dot.
4093-
The numbers are the process start time and the
4092+
consisting of two 4-byte hexadecimal numbers(without leading zeros)
4093+
separated by a dot.The numbers are the process start time and the
40944094
process ID, so <literal>%c</> can also be used as a space saving way
40954095
of printing those items. For example, to generate the session
40964096
identifier from <literal>pg_stat_activity</>, use this query:
40974097
<programlisting>
40984098
SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' ||
4099-
regexp_replace('0000' || '0133e3', '^0*(.{4,})$', '\1')
4099+
to_hex(pid)
41004100
FROM pg_stat_activity;
41014101
</programlisting>
41024102

‎doc/src/sgml/release-9.3.sgml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@
7878
</para>
7979
</listitem>
8080

81-
<listitem>
82-
<para>
83-
Have <quote>session id</> (<literal>%c</>) in <link
84-
linkend="guc-log-line-prefix"><varname>log_line_prefix</></link>
85-
always output at least four hex digits after the period (Bruce Momjian)
86-
</para>
87-
</listitem>
88-
8981
</itemizedlist>
9082

9183
</sect3>

‎src/backend/utils/error/elog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
20872087
}
20882088
break;
20892089
case'c':
2090-
appendStringInfo(buf,"%lx.%04x", (long) (MyStartTime),MyProcPid);
2090+
appendStringInfo(buf,"%lx.%x", (long) (MyStartTime),MyProcPid);
20912091
break;
20922092
case'p':
20932093
appendStringInfo(buf,"%d",MyProcPid);
@@ -2266,7 +2266,7 @@ write_csvlog(ErrorData *edata)
22662266
appendStringInfoChar(&buf,',');
22672267

22682268
/* session id */
2269-
appendStringInfo(&buf,"%lx.%04x", (long)MyStartTime,MyProcPid);
2269+
appendStringInfo(&buf,"%lx.%x", (long)MyStartTime,MyProcPid);
22702270
appendStringInfoChar(&buf,',');
22712271

22722272
/* Line number */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp