Re: format of pg_upgrade loadable_libraries warning

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: format of pg_upgrade loadable_libraries warning
Date: 2019-11-14 19:06:52
Message-ID: 20191114190652.GA23586@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Oct-07, Bruce Momjian wrote:

> Uh, I looked at the pg_ugprade code and the error message is:
>
> pg_fatal("Your installation contains \"contrib/isn\" functions which rely on the\n"
> "bigint data type. Your old and new clusters pass bigint values\n"
> "differently so this cluster cannot currently be upgraded. You can\n"
> "manually upgrade databases that use \"contrib/isn\" facilities and remove\n"
> "\"contrib/isn\" from the old cluster and restart the upgrade. A list of\n"
> "the problem functions is in the file:\n"
> " %s\n\n", output_path);
>
> and the "in database" (which I have changed to capitalized "In database"
> in the attached patch), looks like:
>
> fprintf(script, "In database: %s\n", active_db->db_name);
>
> meaning it _isn't_ an output error message, but rather something that
> appears in an error file. I don't think either of these are translated.
> Is that wrong?

pg_fatal is a "gettext trigger" (see nls.mk), so that part of the
message is definitely translated. And the fprintf format string should
be decorated with _() in order to make translatable too; otherwise the
message is only half-translated when it appears in the pg_upgrade log,
which is not nice. This should look like:

if (!db_used)
{
/* translator: This is an error message indicator */
fprintf(script, _("In database: %s\n"), active_db->db_name);
db_used = true;
}
fprintf(script, " %s.%s\n",

BTW, how is one supposed to "manually upgrade databases that use
contrib/isb"? This part is not very clear.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-11-14 19:27:31 Re: Option to dump foreign data in pg_dump
Previous Message Tom Lane 2019-11-14 18:37:44 Re: SKIP_LOCKED test causes random buildfarm failures