pg_upgrade --check fails to warn about abstime

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pg_upgrade --check fails to warn about abstime
Date: 2023-09-20 16:54:24
Message-ID: 202309201654.ng4ksea25mti@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-pg_upgrade-check-for-types-removed-in-pg12.patch text/x-diff 3.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2023-09-20 17:45:36 Re: pg_upgrade --check fails to warn about abstime
Previous Message Damir 2023-09-20 16:15:15 Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)