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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)
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