Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'
Дата
Msg-id 3428.910625247@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'  (Bruce Momjian <maillist@candle.pha.pa.us>)
Ответы Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'
Список pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Does [stringinfo.c] remove the need for vsnprintf?

Not directly --- the functions it currently provides only know how to
append given strings onto a StringInfo object.  There's no formatting
control.

I'm sure we could program around vsnprintf if we were determined
enough, but there isn't any other equally clean way to do what's
needed in tracing.  Probably better to spend our effort on providing
a reliable emulation of it for platforms that haven't got it.
(BTW, I have no reason to think that the emulation we have is broken;
I was just objecting to starting to depend on it only a week or so
before a major release.)

Actually, what would be *really* whizzy is some way of sprintf'ing
into a StringInfo, with the ability to auto-expand the StringInfo as
needed.  But that requires hooking into the low-level guts of printf,
and AFAIK there's no portable way to do it short of providing your
own complete printf implementation.  Not worth it.
        regards, tom lane


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

Предыдущее
От: Goran Thyni
Дата:
Сообщение: Overruns (was: 'pgsql/src/backend/lib stringinfo.c')
Следующее
От: Goran Thyni
Дата:
Сообщение: Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/backend/lib stringinfo.c'