aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_upgrade/info.c')
-rw-r--r--src/bin/pg_upgrade/info.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/bin/pg_upgrade/info.c b/src/bin/pg_upgrade/info.c
index 5d9a26cf822..1dbc09e6422 100644
--- a/src/bin/pg_upgrade/info.c
+++ b/src/bin/pg_upgrade/info.c
@@ -118,15 +118,9 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
* Verify that rels of same OID have same name. The namespace name
* should always match, but the relname might not match for TOAST
* tables (and, therefore, their indexes).
- *
- * TOAST table names initially match the heap pg_class oid, but
- * pre-9.0 they can change during certain commands such as CLUSTER, so
- * don't insist on a match if old cluster is < 9.0.
*/
if (strcmp(old_rel->nspname, new_rel->nspname) != 0 ||
- (strcmp(old_rel->relname, new_rel->relname) != 0 &&
- (GET_MAJOR_VERSION(old_cluster.major_version) >= 900 ||
- strcmp(old_rel->nspname, "pg_toast") != 0)))
+ strcmp(old_rel->relname, new_rel->relname) != 0)
{
pg_log(PG_WARNING, "Relation names for OID %u in database \"%s\" do not match: "
"old name \"%s.%s\", new name \"%s.%s\"\n",
@@ -352,16 +346,13 @@ get_db_infos(ClusterInfo *cluster)
snprintf(query, sizeof(query),
"SELECT d.oid, d.datname, d.encoding, d.datcollate, d.datctype, "
- "%s AS spclocation "
+ "pg_catalog.pg_tablespace_location(t.oid) AS spclocation "
"FROM pg_catalog.pg_database d "
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
" ON d.dattablespace = t.oid "
"WHERE d.datallowconn = true "
/* we don't preserve pg_database.oid so we sort by name */
- "ORDER BY 2",
- /* 9.2 removed the spclocation column */
- (GET_MAJOR_VERSION(cluster->major_version) <= 901) ?
- "t.spclocation" : "pg_catalog.pg_tablespace_location(t.oid)");
+ "ORDER BY 2");
res = executeQueryOrDie(conn, "%s", query);
@@ -492,7 +483,8 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
*/
snprintf(query + strlen(query), sizeof(query) - strlen(query),
"SELECT all_rels.*, n.nspname, c.relname, "
- " c.relfilenode, c.reltablespace, %s "
+ " c.relfilenode, c.reltablespace, "
+ " pg_catalog.pg_tablespace_location(t.oid) AS spclocation "
"FROM (SELECT * FROM regular_heap "
" UNION ALL "
" SELECT * FROM toast_heap "
@@ -504,11 +496,7 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
" ON c.relnamespace = n.oid "
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "
" ON c.reltablespace = t.oid "
- "ORDER BY 1;",
- /* 9.2 removed the pg_tablespace.spclocation column */
- (GET_MAJOR_VERSION(cluster->major_version) >= 902) ?
- "pg_catalog.pg_tablespace_location(t.oid) AS spclocation" :
- "t.spclocation");
+ "ORDER BY 1;");
res = executeQueryOrDie(conn, "%s", query);