Definition at line 57 of file shell_archive.c.
59{
60 char *xlogarchcmd;
61 char *nativePath = NULL;
62 int rc;
63
64 if (path)
65 {
68 }
69
71 "archive_command", "fp",
72 file, nativePath);
73
76 xlogarchcmd)));
77
80 rc = system(xlogarchcmd);
82
83 if (rc != 0)
84 {
85
86
87
88
89
90
91
92
94
96 {
98 (
errmsg(
"archive command failed with exit code %d",
100 errdetail(
"The failed archive command was: %s",
101 xlogarchcmd)));
102 }
104 {
105#if defined(WIN32)
107 (
errmsg(
"archive command was terminated by exception 0x%X",
109 errhint(
"See C include file \"ntstatus.h\" for a description of the hexadecimal value."),
110 errdetail(
"The failed archive command was: %s",
111 xlogarchcmd)));
112#else
114 (
errmsg(
"archive command was terminated by signal %d: %s",
116 errdetail(
"The failed archive command was: %s",
117 xlogarchcmd)));
118#endif
119 }
120 else
121 {
123 (
errmsg(
"archive command exited with unrecognized status %d",
124 rc),
125 errdetail(
"The failed archive command was: %s",
126 xlogarchcmd)));
127 }
129
130 return false;
131 }
133
134 elog(
DEBUG1,
"archived write-ahead log file \"%s\"", file);
135 return true;
136}
int errmsg_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
static void const char fflush(stdout)
char * pstrdup(const char *in)
void pfree(void *pointer)
char * replace_percent_placeholders(const char *instr, const char *param_name, const char *letters,...)
const char * pg_strsignal(int signum)
void make_native_path(char *filename)
bool wait_result_is_any_signal(int exit_status, bool include_command_not_found)
static void pgstat_report_wait_start(uint32 wait_event_info)
static void pgstat_report_wait_end(void)
References DEBUG1, DEBUG3, elog, ereport, errdetail(), errhint(), errmsg(), errmsg_internal(), FATAL, fflush(), LOG, make_native_path(), pfree(), pg_strsignal(), pgstat_report_wait_end(), pgstat_report_wait_start(), pstrdup(), replace_percent_placeholders(), wait_result_is_any_signal(), WEXITSTATUS, WIFEXITED, WIFSIGNALED, WTERMSIG, and XLogArchiveCommand.