]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
pg_upgrade: Make format strings consistent
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 7 Aug 2025 22:27:14 +0000 (00:27 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 7 Aug 2025 22:29:31 +0000 (00:29 +0200)
The backport of commit f295494d338 introduced a format string using
%m.  This is not wrong, since those have been supported since commit
d6c55de1f99a, but only commit 2c8118ee5d9 later introduced their use
in this file.  This use introduces a gratuitously different
translatable string and also makes it inconsistent with the rest of
the file.  To avoid that, switch this back to the old-style strerror()
route in the appropriate backbranches

src/bin/pg_upgrade/check.c

index 9538cf103dee2d47d3f6524e3af3b0bdaa0a31df..0e0b6a63f414d1acda89bb6a0ecc6e1da2b6750a 100644 (file)
@@ -1255,7 +1255,7 @@ check_for_not_null_inheritance(ClusterInfo *cluster)
                for (int i = 0; i < ntup; i++)
                {
                        if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
-                               pg_fatal("could not open file \"%s\": %m", output_path);
+                               pg_fatal("could not open file \"%s\": %s", output_path, strerror(errno));
                        if (!db_used)
                        {
                                fprintf(script, "In database: %s\n", active_db->db_name);