Re: Add %z support to elog/ereport?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Add %z support to elog/ereport?
Дата
Msg-id 20140121151645.GA17773@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: Add %z support to elog/ereport?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Add %z support to elog/ereport?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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...

> > Perhaps we should jettison entirely the idea of using the operating
> > system's built-in sprintf and use one of our own that has all of the
> > nice widgets we need, like a format code that's guaranteed to be right
> > for uint64 and one that's guaranteed to be right for Size.  This could
> > turn out to be a bad idea if the best sprintf we can write is much
> > slower than the native sprintf on any common platforms ... and maybe
> > it wouldn't play nice with GCC's desire to check format strings.  But
> > what we're doing now is a real nuisance, too.
> 
> Maybe we can use our own implementation if the system's doesn't support
> %z.  It's present in glibc 2.1 at least, and it's part of in the 2004
> edition of POSIX:2001.
> http://pubs.opengroup.org/onlinepubs/009695399/functions/sprintf.html

Yea, I have a patch for that, will send it as soon as some other stuff
is finished.

Greetings,

Andres Freund

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Add %z support to elog/ereport?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: better atomics - v0.2