|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.217 2009/06/02 17:37:55 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.218 2009/06/03 00:38:34 momjian Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter Id="runtime-config">
|
4 | 4 | <title>Server Configuration</title>
|
@@ -3088,7 +3088,14 @@ local0.* /var/log/postgresql
|
3088 | 3088 | consisting of two 4-byte hexadecimal numbers (without leading zeros)
|
3089 | 3089 | separated by a dot. The numbers are the process start time and the
|
3090 | 3090 | process ID, so <literal>%c</> can also be used as a space saving way
|
3091 |
| - of printing those items. |
| 3091 | + of printing those items. For example, to generate the session |
| 3092 | + identifier from <literal>pg_stat_activity</>, use: |
| 3093 | +<programlisting> |
| 3094 | +SELECT to_hex(EXTRACT(EPOCH FROM backend_start)::integer) || '.' || |
| 3095 | + to_hex(procpid) |
| 3096 | +FROM pg_stat_activity; |
| 3097 | +</programlisting> |
| 3098 | + |
3092 | 3099 | </para>
|
3093 | 3100 |
|
3094 | 3101 | <tip>
|
|