Re: %d in log_line_prefix doesn't work for bg/autovacuum workers - Mailing list pgsql-hackers

From Andres Freund
Subject Re: %d in log_line_prefix doesn't work for bg/autovacuum workers
Date
Msg-id 20140516180636.GP23662@alap3.anarazel.de
Whole thread Raw
In response to Re: %d in log_line_prefix doesn't work for bg/autovacuum workers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: %d in log_line_prefix doesn't work for bg/autovacuum workers  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2014-05-16 14:02:44 -0400, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > elog.c's log_line_prefix() processes %d with:
> >             case 'd':
> >                 if (MyProcPort)
> >                 {
> >                     const char *dbname = MyProcPort->database_name;
> 
> >                     if (dbname == NULL || *dbname == '\0')
> >                         dbname = _("[unknown]");
> >                     if (padding != 0)
> >                         appendStringInfo(buf, "%*s", padding, dbname);
> 
> Not directly related to your gripe, but: where did this "padding" logic
> come from, and what prevents it from creating invalidly-encoded output by
> means of truncating multibyte characters in the middle?

Isn't that syntax just the *minimal* width?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: %d in log_line_prefix doesn't work for bg/autovacuum workers
Next
From: David G Johnston
Date:
Subject: Re: chr() is still too loose about UTF8 code points