Skip to content

Commit f7b70df

Browse files
committed
Fix pg_upgrade to print the proper database name for file transfer
failures.
1 parent a3375be commit f7b70df

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

contrib/pg_upgrade/info.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ create_rel_filename_map(const char *old_data, const char *new_data,
107107
if (strcmp(old_rel->nspname, new_rel->nspname) != 0 ||
108108
strcmp(old_rel->relname, new_rel->relname) != 0)
109109
pg_log(PG_FATAL, "mismatch of relation id: database \"%s\", old rel %s.%s, new rel %s.%s\n",
110-
old_db, old_rel->nspname, old_rel->relname,
110+
old_db->db_name, old_rel->nspname, old_rel->relname,
111111
new_rel->nspname, new_rel->relname);
112112

113113
/* used only for logging and error reporing, old/new are identical */
@@ -188,8 +188,8 @@ get_db_infos(ClusterInfo *cluster)
188188
/* we don't preserve pg_database.oid so we sort by name */
189189
"ORDER BY 2");
190190

191-
i_datname = PQfnumber(res, "datname");
192191
i_oid = PQfnumber(res, "oid");
192+
i_datname = PQfnumber(res, "datname");
193193
i_spclocation = PQfnumber(res, "spclocation");
194194

195195
ntups = PQntuples(res);
@@ -198,7 +198,6 @@ get_db_infos(ClusterInfo *cluster)
198198
for (tupnum = 0; tupnum < ntups; tupnum++)
199199
{
200200
dbinfos[tupnum].db_oid = atooid(PQgetvalue(res, tupnum, i_oid));
201-
202201
snprintf(dbinfos[tupnum].db_name, sizeof(dbinfos[tupnum].db_name), "%s",
203202
PQgetvalue(res, tupnum, i_datname));
204203
snprintf(dbinfos[tupnum].db_tblspace, sizeof(dbinfos[tupnum].db_tblspace), "%s",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy