Re: libpq error message refactoring

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: libpq error message refactoring
Дата
Msg-id 20221114101149.pgabiv4eqv4mivqf@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: libpq error message refactoring  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On 2022-Nov-13, Peter Eisentraut wrote:

> On 09.11.22 13:29, Alvaro Herrera wrote:

> > > +    /* Loop in case we have to retry after enlarging the buffer. */
> > > +    do
> > > +    {
> > > +        errno = save_errno;
> > > +        va_start(args, fmt);
> > > +        done = appendPQExpBufferVA(errorMessage, libpq_gettext(fmt), args);
> > 
> > I wonder if it makes sense to do libpq_gettext() just once, instead of
> > redoing it on each iteration.
> 
> I wonder whether that would expose us to potential compiler warnings about
> the format string not being constant.  As long as the compiler can trace
> that the string comes from gettext, it knows what's going on.
> 
> Also, most error strings in practice don't need the loop, so maybe it's not
> a big issue.

True.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: A problem about join ordering
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Time delayed LR (WAS Re: logical replication restrictions)