Re: Adding the extension name to EData / log_line_prefix
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>
Cc: Fabrízio de Royes Mello <fabriziomello@gmail.com>, pgsql-hackers@postgresql.org
Date: 2024-05-15T15:34:06Z
Lists: pgsql-hackers
On 14.05.24 01:11, Tom Lane wrote:
> The mechanism that Andres describes for sourcing the name seems a bit
> overcomplex though. Why not just allow/require each extension to
> specify its name as a constant string? We could force the matter by
> redefining PG_MODULE_MAGIC as taking an argument:
>
> PG_MODULE_MAGIC("hstore");
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.