Removal of doc adjustment and release note mention as well.
</informaltable>
The <literal>%c</> escape prints a quasi-unique session identifier,
- consisting of two 4-byte hexadecimal numbers separated by a dot.
- The numbers are the process start time and the
+ consisting of two 4-byte hexadecimal numbers (without leading zeros)
+ separated by a dot. The numbers are the process start time and the
process ID, so <literal>%c</> can also be used as a space saving way
of printing those items. For example, to generate the session
identifier from <literal>pg_stat_activity</>, use this query:
<programlisting>
SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' ||
- regexp_replace('0000' || '0133e3', '^0*(.{4,})$', '\1')
+ to_hex(pid)
FROM pg_stat_activity;
</programlisting>
</para>
</listitem>
- <listitem>
- <para>
- Have <quote>session id</> (<literal>%c</>) in <link
- linkend="guc-log-line-prefix"><varname>log_line_prefix</></link>
- always output at least four hex digits after the period (Bruce Momjian)
- </para>
- </listitem>
-
</itemizedlist>
</sect3>
}
break;
case 'c':
- appendStringInfo(buf, "%lx.%04x", (long) (MyStartTime), MyProcPid);
+ appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
break;
case 'p':
appendStringInfo(buf, "%d", MyProcPid);
appendStringInfoChar(&buf, ',');
/* session id */
- appendStringInfo(&buf, "%lx.%04x", (long) MyStartTime, MyProcPid);
+ appendStringInfo(&buf, "%lx.%x", (long) MyStartTime, MyProcPid);
appendStringInfoChar(&buf, ',');
/* Line number */