aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2013-05-04 13:15:54 -0400
committerBruce Momjian <bruce@momjian.us>2013-05-04 13:15:54 -0400
commitf87f214b7c09e20d954fae887809c41cc5ca68df (patch)
tree4d56b9466930385d02f78040151b223dccd1e200
parent75d1406a194d16823e786a8d5094abd1e7e5661b (diff)
downloadpostgresql-f87f214b7c09e20d954fae887809c41cc5ca68df.tar.gz
postgresql-f87f214b7c09e20d954fae887809c41cc5ca68df.zip
docs: log_line_prefix session id fix
Restore 4-byte designation for docs. Fix 9.3 doc query to properly pad to four digits. Backpatch to all active branches Per suggestions from Ian Lawrence Barwick
-rw-r--r--doc/src/sgml/config.sgml6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 1b05a31faf6..8323bd6a89d 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4089,14 +4089,14 @@ local0.* /var/log/postgresql
</informaltable>
The <literal>%c</> escape prints a quasi-unique session identifier,
- consisting of two hexadecimal numbers separated by a dot. The numbers
- are the process start time and the
+ consisting of two 4-byte hexadecimal numbers 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) || '.' ||
- to_hex(pid)
+ regexp_replace('0000' || to_hex(pid), '^0*(.*....)$', '\1')
FROM pg_stat_activity;
</programlisting>