Re: Fix for log_line_prefix and session display

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Bruce Momjian *EXTERN*" <bruce(at)momjian(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Fix for log_line_prefix and session display
Date: 2012-10-15 08:01:29
Message-ID: D960CB61B694CF459DCFB4B0128514C208901F5C@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Currently, our session id, displayed by log_line_prefix and CSV
output,
> is made up of the session start time epoch seconds and the process id.
> The problem is that the printf mask is currently %lx.%x, causing a
> process id less than 4096 to not display a full four hex digits after
> the decimal point. I think this is confusing because the number .423
> appears higher than .1423, though it is not. Here is what our current
> output looks like with log_line_prefix="%c: ":
>
> 50785b3e.7ff9: ERROR: syntax error at or near "test" at
character 1
> 50785b3e.7ff9: STATEMENT: test
> 50785b3e.144: ERROR: syntax error at or near "test" at
character 1
> 50785b3e.144: STATEMENT: test
>
> With my fix, here is the updated output:
>
> 507864d3.7ff2: ERROR: syntax error at or near "test" at
character 1
> 507864d3.7ff2: STATEMENT: test
> 507864d3.013d: ERROR: syntax error at or near "test" at
character 1
> 507864d3.013d: STATEMENT: test
>
> Patch attached.

Do you think that anybody wants to apply a linear ordering on
the second part of the session ID? If you need the pid, you
can use %p.

I would say that this change makes sense if it causes disturbance
that the part after the period can be than 4 characters long
(it did not disturb me when I wrote a log file parser).

If that need is not urgent enough, maybe it would be better to
preserve the current behaviour in the (unlikely) event that somebody
relies on it.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Nash 2012-10-15 08:22:00 WebSphere Application Server support for postgres
Previous Message Andres Freund 2012-10-15 07:57:19 Re: [RFC][PATCH] wal decoding, attempt #2 - Design Documents (really attached)