From 14bdb3f13de16523609d838b725540af5e23ddd3 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 18 Jan 2023 11:15:48 +0900 Subject: Refactor code for restoring files via shell commands Presently, restore_command uses a different code path than archive_cleanup_command and recovery_end_command. These code paths are similar and can be easily combined, as long as it is possible to identify if a command should: - Issue a FATAL on signal. - Exit immediately on SIGTERM. While on it, this removes src/common/archive.c and its associated header. Since the introduction of c96de2c, BuildRestoreCommand() has become a simple wrapper of replace_percent_placeholders() able to call make_native_path(). This simplifies shell_restore.c as long as RestoreArchivedFile() includes a call to make_native_path(). Author: Nathan Bossart Reviewed-by: Andres Freund, Michael Paquier Discussion: https://postgr.es/m/20221227192449.GA3672473@nathanxps13 --- src/include/common/archive.h | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 src/include/common/archive.h (limited to 'src/include/common') diff --git a/src/include/common/archive.h b/src/include/common/archive.h deleted file mode 100644 index 95196772c95..00000000000 --- a/src/include/common/archive.h +++ /dev/null @@ -1,21 +0,0 @@ -/*------------------------------------------------------------------------- - * - * archive.h - * Common WAL archive routines - * - * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * src/include/common/archive.h - * - *------------------------------------------------------------------------- - */ -#ifndef ARCHIVE_H -#define ARCHIVE_H - -extern char *BuildRestoreCommand(const char *restoreCommand, - const char *xlogpath, /* %p */ - const char *xlogfname, /* %f */ - const char *lastRestartPointFname); /* %r */ - -#endif /* ARCHIVE_H */ -- cgit v1.2.3