Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
8b06e6ab
Commit
8b06e6ab
authored
May 06, 2013
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert idea of zer-padding padding session id in log_line_prefix
Removal of doc adjustment and release note mention as well.
parent
539ecc92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
doc/src/sgml/config.sgml
doc/src/sgml/config.sgml
+3
-3
doc/src/sgml/release-9.3.sgml
doc/src/sgml/release-9.3.sgml
+0
-8
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+2
-2
No files found.
doc/src/sgml/config.sgml
View file @
8b06e6ab
...
...
@@ -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>
...
...
doc/src/sgml/release-9.3.sgml
View file @
8b06e6ab
...
...
@@ -78,14 +78,6 @@
</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>
...
...
src/backend/utils/error/elog.c
View file @
8b06e6ab
...
...
@@ -2087,7 +2087,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
}
break
;
case
'c'
:
appendStringInfo
(
buf
,
"%lx.%
04
x"
,
(
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.%
04
x"
,
(
long
)
MyStartTime
,
MyProcPid
);
appendStringInfo
(
&
buf
,
"%lx.%x"
,
(
long
)
MyStartTime
,
MyProcPid
);
appendStringInfoChar
(
&
buf
,
','
);
/* Line number */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment