1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

In pg_upgrade, remove use of whichCluster, and just pass old/new cluster

pointers, which simplifies the code.  This was not possible in 9.0 because
everything was in a single nested struct, but is possible now.

Per suggestion from Tom.
This commit is contained in:
Bruce Momjian
2011-01-01 12:06:36 -05:00
parent f82b3e58f8
commit 6e6bee987f
11 changed files with 181 additions and 227 deletions

View File

@ -77,10 +77,9 @@ transfer_all_new_dbs(DbInfoArr *olddb_arr,
* relfilenodes later in the upgrade process.
*/
void
get_pg_database_relfilenode(Cluster whichCluster)
get_pg_database_relfilenode(ClusterInfo *cluster)
{
PGconn *conn = connectToServer("template1", whichCluster);
ClusterInfo *active_cluster = ACTIVE_CLUSTER(whichCluster);
PGconn *conn = connectToServer(cluster, "template1");
PGresult *res;
int i_relfile;
@ -94,7 +93,7 @@ get_pg_database_relfilenode(Cluster whichCluster)
"ORDER BY c.relname");
i_relfile = PQfnumber(res, "relfilenode");
active_cluster->pg_database_oid = atooid(PQgetvalue(res, 0, i_relfile));
cluster->pg_database_oid = atooid(PQgetvalue(res, 0, i_relfile));
PQclear(res);
PQfinish(conn);