mirror of
https://github.com/postgres/postgres.git
synced 2025-05-20 00:03:14 -04:00
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
This commit is contained in:
parent
75d1406a19
commit
f87f214b7c
@ -4089,14 +4089,14 @@ local0.* /var/log/postgresql
|
|||||||
</informaltable>
|
</informaltable>
|
||||||
|
|
||||||
The <literal>%c</> escape prints a quasi-unique session identifier,
|
The <literal>%c</> escape prints a quasi-unique session identifier,
|
||||||
consisting of two hexadecimal numbers separated by a dot. The numbers
|
consisting of two 4-byte hexadecimal numbers separated by a dot.
|
||||||
are the process start time and the
|
The numbers are the process start time and the
|
||||||
process ID, so <literal>%c</> can also be used as a space saving way
|
process ID, so <literal>%c</> can also be used as a space saving way
|
||||||
of printing those items. For example, to generate the session
|
of printing those items. For example, to generate the session
|
||||||
identifier from <literal>pg_stat_activity</>, use this query:
|
identifier from <literal>pg_stat_activity</>, use this query:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' ||
|
SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' ||
|
||||||
to_hex(pid)
|
regexp_replace('0000' || to_hex(pid), '^0*(.*....)$', '\1')
|
||||||
FROM pg_stat_activity;
|
FROM pg_stat_activity;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user