Re: Add %z support to elog/ereport? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add %z support to elog/ereport?
Date
Msg-id 28854.1390322020@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add %z support to elog/ereport?  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Add %z support to elog/ereport?  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2014-01-21 12:11:23 -0300, Alvaro Herrera wrote:
>> How difficult would it be to have expand_fmt_string deal with positional
>> modifiers?  I don't think we need anything from it other than the %n$
>> notation, so perhaps it's not so problematic.

> I don't think there's much reason to go there. I didn't go for the
> pg-supplied sprintf() because I thought it'd be considered to
> invasive. Since that's apparently not the case...

Yeah, that would make expand_fmt_string considerably more complicated
and so presumably slower.  We don't really need that when we can make
what I expect is a pretty trivial addition to snprintf.c.  Also, fixing
snprintf.c will make it safe to use the z flag in contexts other than
ereport/elog.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: proposal: hide application_name from other users
Next
From: Bruce Momjian
Date:
Subject: Re: Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance (summary v2 2014-1-17)