PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
archive.c File Reference
#include "postgres.h"
#include "common/archive.h"
#include "common/percentrepl.h"
Include dependency graph for archive.c:

Go to the source code of this file.

Functions

char * BuildRestoreCommand (const char *restoreCommand, const char *xlogpath, const char *xlogfname, const char *lastRestartPointFname)
 

Function Documentation

◆ BuildRestoreCommand()

char* BuildRestoreCommand ( const char *  restoreCommand,
const char *  xlogpath,
const char *  xlogfname,
const char *  lastRestartPointFname 
)

Definition at line 39 of file archive.c.

43 {
44  char *nativePath = NULL;
45  char *result;
46 
47  if (xlogpath)
48  {
49  nativePath = pstrdup(xlogpath);
50  make_native_path(nativePath);
51  }
52 
53  result = replace_percent_placeholders(restoreCommand, "restore_command", "frp",
54  xlogfname, lastRestartPointFname, nativePath);
55 
56  if (nativePath)
57  pfree(nativePath);
58 
59  return result;
60 }
char * pstrdup(const char *in)
Definition: mcxt.c:1696
void pfree(void *pointer)
Definition: mcxt.c:1521
char * replace_percent_placeholders(const char *instr, const char *param_name, const char *letters,...)
Definition: percentrepl.c:59
void make_native_path(char *filename)
Definition: path.c:168

References make_native_path(), pfree(), pstrdup(), and replace_percent_placeholders().

Referenced by RestoreArchivedFile().