1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

Remove unused columns from pg_upgrade's query

Commit 9637badd9f removed the use of these collation-related fields in
the result set, moving that to a different query, but forgot to remove
the columns from the query.
This commit is contained in:
Heikki Linnakangas
2026-09-18 22:14:09 +03:00
parent bb1e3e4756
commit 484b3e1d83

View File

@@ -401,23 +401,13 @@ get_db_infos(ClusterInfo *cluster)
int ntups;
int tupnum;
DbInfo *dbinfos;
int i_datname,
i_oid,
int i_oid,
i_datname,
i_spclocation;
char query[QUERY_ALLOC];
snprintf(query, sizeof(query),
"SELECT d.oid, d.datname, d.encoding, d.datcollate, d.datctype, ");
if (GET_MAJOR_VERSION(cluster->major_version) >= 1700)
snprintf(query + strlen(query), sizeof(query) - strlen(query),
"datlocprovider, datlocale, ");
else if (GET_MAJOR_VERSION(cluster->major_version) >= 1500)
snprintf(query + strlen(query), sizeof(query) - strlen(query),
"datlocprovider, daticulocale AS datlocale, ");
else
snprintf(query + strlen(query), sizeof(query) - strlen(query),
"'c' AS datlocprovider, NULL AS datlocale, ");
snprintf(query + strlen(query), sizeof(query) - strlen(query),
"SELECT d.oid, d.datname, "
"pg_catalog.pg_tablespace_location(t.oid) AS spclocation "
"FROM pg_catalog.pg_database d "
" LEFT OUTER JOIN pg_catalog.pg_tablespace t "