pg_upgrade --check fails to warn about abstime - Mailing list pgsql-hackers

From Alvaro Herrera
Subject pg_upgrade --check fails to warn about abstime
Date
Msg-id 202309201654.ng4ksea25mti@alvherre.pgsql
Whole thread Raw
Responses Re: pg_upgrade --check fails to warn about abstime
Re: pg_upgrade --check fails to warn about abstime
Re: pg_upgrade --check fails to warn about abstime
List pgsql-hackers
I got a complaint that pg_upgrade --check fails to raise red flags when
the source database contains type abstime when upgrading from pg11.  The
type (along with reltime and tinterval) was removed by pg12.


In passing, while testing this, I noticed that the translation
infrastructure in pg_upgrade/util.c is broken: we do have the messages
in the translation catalog, but the translations for the messages from
prep_status are never displayed.  So I made the quick hack of adding _()
around the fmt, and this was the result:

Verificando Consistencia en Vivo en el Servidor Antiguo
-------------------------------------------------------
Verificando las versiones de los clústers                    éxito
Verificando que el usuario de base de datos es el usuario de instalaciónéxito
Verificando los parámetros de conexión de bases de datos    éxito
Verificando transacciones preparadas                          éxito
Verificando tipos compuestos definidos por el sistema en tablas de usuarioéxito
Verificando tipos de datos reg* en datos de usuario           éxito
Verificando contrib/isn con discordancia en mecanismo de paso de bigintéxito
Checking for incompatible "aclitem" data type in user tables  éxito
Checking for removed "abstime" data type in user tables       éxito
Checking for removed "reltime" data type in user tables       éxito
Checking for removed "tinterval" data type in user tables     éxito
Verificando conversiones de codificación definidas por el usuarioéxito
Verificando operadores postfix definidos por el usuario       éxito
Verificando funciones polimórficas incompatibles             éxito
Verificando tablas WITH OIDS                                  éxito
Verificando columnas de usuario del tipo «sql_identifier»   éxito
Verificando la presencia de las bibliotecas requeridas        éxito
Verificando que el usuario de base de datos es el usuario de instalaciónéxito
Verificando transacciones preparadas                          éxito
Verificando los directorios de tablespaces para el nuevo clústeréxito

Note how nicely they line up ... not.  There is some code that claims to
do this correctly, but apparently it counts bytes, not characters, and
also it appears to be measuring the original rather than the
translation.

I think we're trimming the strings in the wrong places.  We need to
apply _() to the originals, not the trimmed ones.  Anyway, clearly
nobody has looked at this very much.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"We’ve narrowed the problem down to the customer’s pants being in a situation
 of vigorous combustion" (Robert Haas, Postgres expert extraordinaire)

Attachment

pgsql-hackers by date:

Previous
From: Damir
Date:
Subject: Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)
Next
From: "Tristan Partin"
Date:
Subject: Re: pg_upgrade --check fails to warn about abstime