diff options
author | Bruce Momjian <bruce@momjian.us> | 2011-01-07 21:25:34 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2011-01-07 21:26:13 -0500 |
commit | 2896c87ce4dc789722296f010eaefd5cbb86ece3 (patch) | |
tree | 5e98d2ca57edf90e7224dfe1ddf0764dc6a56bef /contrib/pg_upgrade/pg_upgrade.c | |
parent | 541fc3d4df66a5e51d172a78288069bd92dda0c8 (diff) |
Force pg_upgrade's to preserve pg_class.oid, not pg_class.relfilenode.
Toast tables have identical pg_class.oid and pg_class.relfilenode, but
for clarity it is good to preserve the pg_class.oid.
Update comments regarding what is preserved, and do some
variable/function renaming for clarity.
Diffstat (limited to 'contrib/pg_upgrade/pg_upgrade.c')
-rw-r--r-- | contrib/pg_upgrade/pg_upgrade.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c index 820445ce557..3de47fc62ec 100644 --- a/contrib/pg_upgrade/pg_upgrade.c +++ b/contrib/pg_upgrade/pg_upgrade.c @@ -8,23 +8,30 @@ */ /* - * To simplify the upgrade process, we force certain system items to be - * consistent between old and new clusters: + * To simplify the upgrade process, we force certain system values to be + * identical between old and new clusters: * - * We control all assignments of pg_class.relfilenode so we can keep the - * same relfilenodes for old and new files. The only exception is - * pg_largeobject, pg_largeobject_metadata, and its indexes, which can - * change due to a cluster, reindex, or vacuum full. (We don't create - * those so have no control over their oid/relfilenode values.) + * We control all assignments of pg_class.oid (and relfilenode) so toast + * oids are the same between old and new clusters. This is important + * because toast oids are stored as toast pointers in user tables. * - * While pg_class.oid and pg_class.relfilenode are intially the same, they - * can diverge due to cluster, reindex, or vacuum full. The new cluster - * will again have matching pg_class.relfilenode and pg_class.oid values, - * but based on the new relfilenode value, so the old/new oids might - * differ. + * The only place where old/new relfilenode might not match is + * pg_largeobject, pg_largeobject_metadata, and its indexes, + * which can change their relfilenode values due to a cluster, reindex, + * or vacuum full. (We don't create those so have no control over their + * new relfilenode values.) * - * We control all assignments of pg_type.oid because these are stored - * in composite types. + * FYI, while pg_class.oid and pg_class.relfilenode are intially the same + * in a cluster, but they can diverge due to cluster, reindex, or vacuum + * full. The new cluster will again have matching pg_class.relfilenode + * and pg_class.oid values, but based on the old relfilenode value, so the + * old/new oids might differ. + * + * We control all assignments of pg_type.oid because these oid are stored + * in user composite type values. + * + * We control all assignments of pg_enum.oid because these oid are stored + * in user tables as enum values. */ |