Re: Different gettext domain needed for error context

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Different gettext domain needed for error context
Date: 2012-02-15 18:13:37
Message-ID: 29396.1329329617@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-02-15 18:23:59 Re: run GUC check hooks on RESET
Previous Message Tom Lane 2012-02-15 17:58:01 REASSIGN OWNED lacks support for FDWs