Skip to content

Commit b95aec5

Browse files
committed
Fix new SQL tablespace location function usage in pg_upgrade to properly
check cluster version numbers, and fix missing table alias.
1 parent 443b482 commit b95aec5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

contrib/pg_upgrade/info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ get_db_infos(ClusterInfo *cluster)
204204
/* we don't preserve pg_database.oid so we sort by name */
205205
"ORDER BY 2",
206206
/* 9.2 removed the spclocation column */
207-
(GET_MAJOR_VERSION(old_cluster.major_version) <= 901) ?
207+
(GET_MAJOR_VERSION(cluster->major_version) <= 901) ?
208208
"t.spclocation" : "pg_catalog.pg_tablespace_location(t.oid) AS spclocation");
209209

210210
res = executeQueryOrDie(conn, "%s", query);
@@ -287,7 +287,7 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
287287
/* we preserve pg_class.oid so we sort by it to match old/new */
288288
"ORDER BY 1;",
289289
/* 9.2 removed the spclocation column */
290-
(GET_MAJOR_VERSION(old_cluster.major_version) <= 901) ?
290+
(GET_MAJOR_VERSION(cluster->major_version) <= 901) ?
291291
"t.spclocation" : "pg_catalog.pg_tablespace_location(t.oid) AS spclocation",
292292
/* see the comment at the top of old_8_3_create_sequence_script() */
293293
(GET_MAJOR_VERSION(old_cluster.major_version) <= 803) ?

contrib/pg_upgrade/tablespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ get_tablespace_paths(void)
5353
" spcname != 'pg_global'",
5454
/* 9.2 removed the spclocation column */
5555
(GET_MAJOR_VERSION(old_cluster.major_version) <= 901) ?
56-
"t.spclocation" : "pg_catalog.pg_tablespace_location(oid) AS spclocation");
56+
"spclocation" : "pg_catalog.pg_tablespace_location(oid) AS spclocation");
5757

5858
res = executeQueryOrDie(conn, "%s", query);
5959

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