Revert idea of zer-padding padding session id in log_line_prefix
authorBruce Momjian <bruce@momjian.us>
Mon, 6 May 2013 12:59:39 +0000 (08:59 -0400)
committerBruce Momjian <bruce@momjian.us>
Mon, 6 May 2013 12:59:39 +0000 (08:59 -0400)
Removal of doc adjustment and release note mention as well.

doc/src/sgml/config.sgml
doc/src/sgml/release-9.3.sgml
src/backend/utils/error/elog.c

index 7b3e61794707307c6ee63eec5cfc1ffa484d2d91..d750f0800b70083311112904c90658110d33b96c 100644 (file)
@@ -4089,14 +4089,14 @@ local0.*    /var/log/postgresql
          </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>
 
index 32839b7d2f1b1792276f8c4f7fa880b38a34d617..d64e8e357f194e4d0f71df531d186a51e9eac800 100644 (file)
        </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>
index 3a211bf4cd9c3a45849a410eedcfd7d2347438ab..f8cf190e65222358d07d274eafe0f20085447d94 100644 (file)
@@ -2087,7 +2087,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
                }
                break;
            case 'c':
-               appendStringInfo(buf, "%lx.%04x", (long) (MyStartTime), MyProcPid);
+               appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
                break;
            case 'p':
                appendStringInfo(buf, "%d", MyProcPid);
@@ -2266,7 +2266,7 @@ write_csvlog(ErrorData *edata)
    appendStringInfoChar(&buf, ',');
 
    /* session id */
-   appendStringInfo(&buf, "%lx.%04x", (long) MyStartTime, MyProcPid);
+   appendStringInfo(&buf, "%lx.%x", (long) MyStartTime, MyProcPid);
    appendStringInfoChar(&buf, ',');
 
    /* Line number */