Re: Adding the extension name to EData / log_line_prefix

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adding the extension name to EData / log_line_prefix
Date: 2024-05-16 11:43:10
Message-ID: 64b4aedb-7f29-483e-9536-59dcc6b73d74@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15.05.24 17:50, Tom Lane wrote:
>> We kind of already have something like this, for NLS. If you look for
>> pg_bindtextdomain(TEXTDOMAIN) and ereport_domain(), this information
>> already trickles into the vicinity of the error data. Maybe the same
>> thing could just be used for this, by wiring up the macros a bit
>> differently.
> Hmm, cute idea, but it'd only help for extensions that are
> NLS-enabled. Which I bet is a tiny fraction of the population.
> So far as I can find, we don't even document how to set up
> TEXTDOMAIN for an extension --- you have to cargo-cult the
> macro definition from some in-core extension.

Yeah, the whole thing is a bit mysterious, and we don't need to use the
exact mechanism we have now.

But abstractly, we should only have to specify the, uh, domain of the
log messages once. Whether that is used for building a message catalog
or tagging the server log, those are just two different downstream uses
of the same piece of information.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-05-16 11:56:33 Re: GUC names in messages
Previous Message Peter Eisentraut 2024-05-16 11:35:29 Re: GUC names in messages