Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 51eeccd

Browse files
committed
Add removal of PG_VERSION to optional old cluster deletion script.
Backpatch to 9.0.X.
1 parent f75d6a1 commit 51eeccd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

contrib/pg_upgrade/check.c

+5
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
416416
int dbnum;
417417

418418
fprintf(script, "\n");
419+
/* remove PG_VERSION? */
420+
if (GET_MAJOR_VERSION(ctx->old.major_version) <= 804)
421+
fprintf(script, RM_CMD " %s%s/PG_VERSION\n",
422+
ctx->tablespaces[tblnum], ctx->old.tablespace_suffix);
423+
419424
for (dbnum = 0; dbnum < ctx->new.dbarr.ndbs; dbnum++)
420425
{
421426
fprintf(script, RMDIR_CMD " %s%s/%d\n",

contrib/pg_upgrade/pg_upgrade.h

+2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
#define pg_copy_file copy_file
3939
#define pg_mv_file rename
4040
#define pg_link_file link
41+
#define RM_CMD "rm -f"
4142
#define RMDIR_CMD "rm -rf"
4243
#define SHELL_EXT "sh"
4344
#else
4445
#define pg_copy_file CopyFile
4546
#define pg_mv_file pgrename
4647
#define pg_link_file win32_pghardlink
4748
#define sleep(x) Sleep(x * 1000)
49+
#define RM_CMD "DEL /q"
4850
#define RMDIR_CMD "RMDIR /s/q"
4951
#define SHELL_EXT "bat"
5052
#define EXE_EXT ".exe"

0 commit comments

Comments
 (0)