From 2f657e4d720d08b26234f3b9e40e347f3cc42220 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Fri, 7 Jan 2011 22:57:30 -0500
Subject: [PATCH] More pg_upgrade relfilenode C comments added.

---
 contrib/pg_upgrade/info.c       | 6 ++++++
 contrib/pg_upgrade/pg_upgrade.c | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index 301f6bb9b8f..4360d39d334 100644
--- a/contrib/pg_upgrade/info.c
+++ b/contrib/pg_upgrade/info.c
@@ -132,7 +132,13 @@ create_rel_filename_map(const char *old_data, const char *new_data,
 				 new_cluster.tablespace_suffix, new_db->db_oid);
 	}
 
+	/*
+	 *	old_relfilenode might differ from pg_class.oid (and hence
+	 *	new_relfilenode) because of CLUSTER, REINDEX, or VACUUM FULL.
+	 */
 	map->old_relfilenode = old_rel->relfilenode;
+
+	/* new_relfilenode will match old and new pg_class.oid */
 	map->new_relfilenode = new_rel->relfilenode;
 
 	/* used only for logging and error reporing, old/new are identical */
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
index 9a5ef0fd205..42da3ea0df7 100644
--- a/contrib/pg_upgrade/pg_upgrade.c
+++ b/contrib/pg_upgrade/pg_upgrade.c
@@ -19,7 +19,9 @@
  *	in a cluster, but they can diverge due to CLUSTER, REINDEX, or VACUUM
  *	FULL.  The new cluster will have matching pg_class.oid and
  *	pg_class.relfilenode values and be based on the old oid value.  This can
- *	cause the old and new pg_class.relfilenode values to differ.
+ *	cause the old and new pg_class.relfilenode values to differ.  In summary,
+ *	old and new pg_class.oid and new pg_class.relfilenode will have the
+ *	same value, and old pg_class.relfilenode might differ.
  *
  *	We control all assignments of pg_type.oid because these oids are stored
  *	in user composite type values.
-- 
GitLab