Skip to content

Commit b1f2a94

Browse files
committed
In pg_upgrade, adjust transfer_relfile()'s parameters to be more logical.
1 parent 5cff5b5 commit b1f2a94

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

contrib/pg_upgrade/relfilenode.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ static void transfer_single_new_db(pageCnvCtx *pageConverter,
1717
FileNameMap *maps, int size);
1818
static void transfer_relfile(pageCnvCtx *pageConverter,
1919
const char *fromfile, const char *tofile,
20-
const char *oldnspname, const char *oldrelname,
21-
const char *newnspname, const char *newrelname);
20+
const char *old_nspname, const char *new_nspname,
21+
const char *old_relname, const char *new_relname);
2222

2323
/* used by scandir(), must be global */
2424
char scandir_file_pattern[MAXPGPATH];
@@ -149,8 +149,8 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
149149
*/
150150
unlink(new_file);
151151
transfer_relfile(pageConverter, old_file, new_file,
152-
maps[mapnum].old_nspname, maps[mapnum].old_relname,
153-
maps[mapnum].new_nspname, maps[mapnum].new_relname);
152+
maps[mapnum].old_nspname, maps[mapnum].new_nspname,
153+
maps[mapnum].old_relname, maps[mapnum].new_relname);
154154

155155
/* fsm/vm files added in PG 8.4 */
156156
if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804)
@@ -173,8 +173,8 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
173173

174174
unlink(new_file);
175175
transfer_relfile(pageConverter, old_file, new_file,
176-
maps[mapnum].old_nspname, maps[mapnum].old_relname,
177-
maps[mapnum].new_nspname, maps[mapnum].new_relname);
176+
maps[mapnum].old_nspname, maps[mapnum].new_nspname,
177+
maps[mapnum].old_relname, maps[mapnum].new_relname);
178178
}
179179
}
180180
}
@@ -201,8 +201,8 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
201201

202202
unlink(new_file);
203203
transfer_relfile(pageConverter, old_file, new_file,
204-
maps[mapnum].old_nspname, maps[mapnum].old_relname,
205-
maps[mapnum].new_nspname, maps[mapnum].new_relname);
204+
maps[mapnum].old_nspname, maps[mapnum].new_nspname,
205+
maps[mapnum].old_relname, maps[mapnum].new_relname);
206206
}
207207
}
208208
}
@@ -223,9 +223,9 @@ transfer_single_new_db(pageCnvCtx *pageConverter,
223223
* Copy or link file from old cluster to new one.
224224
*/
225225
static void
226-
transfer_relfile(pageCnvCtx *pageConverter, const char *oldfile,
227-
const char *newfile, const char *oldnspname, const char *oldrelname,
228-
const char *newnspname, const char *newrelname)
226+
transfer_relfile(pageCnvCtx *pageConverter, const char *old_file,
227+
const char *new_file, const char *old_nspname, const char *new_nspname,
228+
const char *old_relname, const char *new_relname)
229229
{
230230
const char *msg;
231231

@@ -235,21 +235,21 @@ transfer_relfile(pageCnvCtx *pageConverter, const char *oldfile,
235235

236236
if (user_opts.transfer_mode == TRANSFER_MODE_COPY)
237237
{
238-
pg_log(PG_INFO, "copying %s to %s\n", oldfile, newfile);
238+
pg_log(PG_INFO, "copying %s to %s\n", old_file, new_file);
239239

240-
if ((msg = copyAndUpdateFile(pageConverter, oldfile, newfile, true)) != NULL)
240+
if ((msg = copyAndUpdateFile(pageConverter, old_file, new_file, true)) != NULL)
241241
pg_log(PG_FATAL, "error while copying %s.%s(%s) to %s.%s(%s): %s\n",
242-
oldnspname, oldrelname, oldfile, newnspname, newrelname, newfile, msg);
242+
old_nspname, old_relname, old_file, new_nspname, new_relname, new_file, msg);
243243
}
244244
else
245245
{
246-
pg_log(PG_INFO, "linking %s to %s\n", oldfile, newfile);
246+
pg_log(PG_INFO, "linking %s to %s\n", old_file, new_file);
247247

248-
if ((msg = linkAndUpdateFile(pageConverter, oldfile, newfile)) != NULL)
248+
if ((msg = linkAndUpdateFile(pageConverter, old_file, new_file)) != NULL)
249249
pg_log(PG_FATAL,
250250
"error while creating link from %s.%s(%s) to %s.%s(%s): %s\n",
251-
oldnspname, oldrelname, oldfile, newnspname, newrelname,
252-
newfile, msg);
251+
old_nspname, old_relname, old_file, new_nspname, new_relname,
252+
new_file, msg);
253253
}
254254
return;
255255
}

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