From e9c8b6013ee4e5547338f05ad62227f17c402cfe Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 3 Jun 2009 00:38:34 +0000 Subject: [PATCH] Add example of how to generate the session identifier from pg_stat_activity. --- doc/src/sgml/config.sgml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index b2e3ad3f97..b30e8e2e66 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3088,7 +3088,14 @@ local0.* /var/log/postgresql 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 %c can also be used as a space saving way - of printing those items. + of printing those items. For example, to generate the session + identifier from pg_stat_activity, use: + +SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' || + to_hex(procpid) +FROM pg_stat_activity; + + -- 2.30.2