Re: 9.3 release notes suggestions

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.3 release notes suggestions
Date: 2013-05-04 15:05:26
Message-ID: 20130504150526.GG5631@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 4, 2013 at 11:55:09PM +0900, Ian Lawrence Barwick wrote:
> >> more pedantically
> >> accurate:
> >>
> >> <listitem>
> >> <para>
> >> Have <quote>session id</> (<literal>%c</>) in <link
> >> linkend="guc-log-line-prefix"><varname>log_line_prefix</></link>
> >> always pad the PID value with zeros so at least four hex digits are
> >> displayed after the period (Bruce Momjian)
> >> </para>
> >> </listitem>
> >
> > OK, changed to:
> >
> > 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)
> >
> > This is such a minor change I am trying to keep it short.
>
> Just out of curiosity, what was the reason for the change in the first place?
> (Not that it's something I'm particularly passionate about, I just noticed it
> when listing changes with potential backwards-compatibilty effects for
> the wiki).

Well, basically, if you used %c in log_line_prefix, the session id was
not a fixed length, so your output shifted around based on the pid, see:

http://www.postgresql.org/message-id/20121012185127.GB31038@momjian.us

Always showing four digits seems to give greater consistency to the
log output.

> >> if my slightly disengaged brain is grokking the source correctly:
> >>
> >> src/backend/utils/error/elog.c:
> >> appendStringInfo(buf, "%lx.%04x", (long) (MyStartTime), MyProcPid);
> >
> > Yep.
>
> In that case maybe the docs need updating as well?
>
> http://www.postgresql.org/docs/devel/static/runtime-config-logging.html#GUC-LOG-LINE-PREFIX
> "The %c escape prints a quasi-unique session identifier, consisting of
> two 4-byte hexadecimal numbers (without leading zeros)" separated by a
> dot.

Uh, that was never right, because the part before the dot is the session
start timestamp, and that is 8 hex digits:

50785b3e.7ff9

I have changed the text to:

The <literal>%c</> escape prints a quasi-unique session identifier,
consisting of two hexadecimal numbers separated by a dot.

Doc fix backpatched to 9.2.X.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2013-05-04 15:12:31 Re: 9.3 release notes suggestions (typo)
Previous Message Ian Lawrence Barwick 2013-05-04 14:55:09 Re: 9.3 release notes suggestions