Re: Support for XLogRecPtr in expand_fmt_string?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Support for XLogRecPtr in expand_fmt_string?
Дата
Msg-id 12449.1341342631@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Support for XLogRecPtr in expand_fmt_string?  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On Tuesday, July 03, 2012 08:09:40 PM Tom Lane wrote:
>> If we really feel this is worth doing something about, we could invent a
>> formatting subroutine that converts XLogRecPtr to string (and then we
>> just use %s in the messages).

> I think that would make memory management annoying. Using a static buffer 
> isn't going to work very well either because its valid to pass two recptr's to 
> elog/ereport/....

Hm.  I was assuming that we could probably get away with the
static-buffer trick, but if you think not ...

One possibility is to make call sites that need this pass local-variable
buffers to the formatting subroutine:
char    xrp_buffer[XLOGRECPTR_BUF_LEN];char    xrp_buffer2[XLOGRECPTR_BUF_LEN];
ereport(....,    format_xlogrecptr(xrp_buffer, xlogval1),    format_xlogrecptr(xrp_buffer2, xlogval2));

but it may not be worth the trouble.
        regards, tom lane


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Support for XLogRecPtr in expand_fmt_string?
Следующее
От: Magnus Hagander
Дата:
Сообщение: pgfoundry references in docs