From a45beaac642147ebf2e561cce62967d244c343c6 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Wed, 5 Jan 2011 13:52:44 -0500
Subject: [PATCH] Fix for recent pg_upgrade commit to fix large objects
 relfilenode handling.  (metadata user ids still an open issue).

---
 contrib/pg_upgrade/info.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index 83afb926887..01adc33f089 100644
--- a/contrib/pg_upgrade/info.c
+++ b/contrib/pg_upgrade/info.c
@@ -47,33 +47,33 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
 
 	for (relnum = 0; relnum < old_db->rel_arr.nrels; relnum++)
 	{
-		RelInfo    *oldrel = &old_db->rel_arr.rels[relnum];
-		RelInfo    *newrel;
+		RelInfo    *old_rel = &old_db->rel_arr.rels[relnum];
+		RelInfo    *new_rel;
 
 		/* toast tables are handled by their parents */
-		if (strcmp(oldrel->nspname, "pg_toast") == 0)
+		if (strcmp(old_rel->nspname, "pg_toast") == 0)
 			continue;
 
-		newrel = relarr_lookup_rel_name(&old_cluster, &old_db->rel_arr,
-								   oldrel->nspname, oldrel->relname);
+		new_rel = relarr_lookup_rel_name(&new_cluster, &new_db->rel_arr,
+								   old_rel->nspname, old_rel->relname);
 
 		create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db,
-				oldrel, newrel, maps + num_maps);
+				old_rel, new_rel, maps + num_maps);
 		num_maps++;
 
 		/*
 		 * So much for mapping this relation;  now we need a mapping
 		 * for its corresponding toast relation and toast index, if any.
 		 */
-		if (oldrel->toastrelid > 0)
+		if (old_rel->toastrelid > 0)
 		{
 			char		old_name[MAXPGPATH], new_name[MAXPGPATH];
 			RelInfo    *old_toast, *new_toast;
 
 			old_toast = relarr_lookup_rel_oid(&old_cluster, &old_db->rel_arr,
-											  oldrel->toastrelid);
+											  old_rel->toastrelid);
 			new_toast = relarr_lookup_rel_oid(&new_cluster, &new_db->rel_arr,
-											  newrel->toastrelid);
+											  new_rel->toastrelid);
 
 			create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db,
 					old_toast, new_toast, maps + num_maps);
-- 
GitLab