Re: Different gettext domain needed for error context

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Different gettext domain needed for error context
Дата
Msg-id 29396.1329329617@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Different gettext domain needed for error context  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Different gettext domain needed for error context  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> To fix this, we need to somehow pass the caller's text domain to 
> errcontext(). The most straightforward way is to pass it as an extra 
> argument. Ideally, errcontext() would be a macro that passes TEXTDOMAIN 
> to the underlying function, so that you don't need to change all the 
> callers of errcontext():

> #define errcontext(...) errcontext_domain(TEXTDOMAIN, ...)

> But that doesn't work, because it would require varags macros. Anyone 
> know a trick to make that work?

This is pretty ugly, but AFAICS it should work:

#define errcontext set_errcontext_domain(TEXTDOMAIN), real_errcontext

But it might be better in the long run to bite the bullet and make
people change all their errcontext calls.  There aren't that many,
especially not outside the core code.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: REASSIGN OWNED lacks support for FDWs
Следующее
От: Robert Haas
Дата:
Сообщение: Re: run GUC check hooks on RESET