mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-30 19:00:29 +08:00
Add removal of PG_VERSION to optional old cluster deletion script.
Backpatch to 9.0.X.
This commit is contained in:
parent
f75d6a1b19
commit
51eeccd6cc
@ -416,6 +416,11 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
|
|||||||
int dbnum;
|
int dbnum;
|
||||||
|
|
||||||
fprintf(script, "\n");
|
fprintf(script, "\n");
|
||||||
|
/* remove PG_VERSION? */
|
||||||
|
if (GET_MAJOR_VERSION(ctx->old.major_version) <= 804)
|
||||||
|
fprintf(script, RM_CMD " %s%s/PG_VERSION\n",
|
||||||
|
ctx->tablespaces[tblnum], ctx->old.tablespace_suffix);
|
||||||
|
|
||||||
for (dbnum = 0; dbnum < ctx->new.dbarr.ndbs; dbnum++)
|
for (dbnum = 0; dbnum < ctx->new.dbarr.ndbs; dbnum++)
|
||||||
{
|
{
|
||||||
fprintf(script, RMDIR_CMD " %s%s/%d\n",
|
fprintf(script, RMDIR_CMD " %s%s/%d\n",
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#define pg_copy_file copy_file
|
#define pg_copy_file copy_file
|
||||||
#define pg_mv_file rename
|
#define pg_mv_file rename
|
||||||
#define pg_link_file link
|
#define pg_link_file link
|
||||||
|
#define RM_CMD "rm -f"
|
||||||
#define RMDIR_CMD "rm -rf"
|
#define RMDIR_CMD "rm -rf"
|
||||||
#define SHELL_EXT "sh"
|
#define SHELL_EXT "sh"
|
||||||
#else
|
#else
|
||||||
@ -45,6 +46,7 @@
|
|||||||
#define pg_mv_file pgrename
|
#define pg_mv_file pgrename
|
||||||
#define pg_link_file win32_pghardlink
|
#define pg_link_file win32_pghardlink
|
||||||
#define sleep(x) Sleep(x * 1000)
|
#define sleep(x) Sleep(x * 1000)
|
||||||
|
#define RM_CMD "DEL /q"
|
||||||
#define RMDIR_CMD "RMDIR /s/q"
|
#define RMDIR_CMD "RMDIR /s/q"
|
||||||
#define SHELL_EXT "bat"
|
#define SHELL_EXT "bat"
|
||||||
#define EXE_EXT ".exe"
|
#define EXE_EXT ".exe"
|
||||||
|
Loading…
Reference in New Issue
Block a user