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