1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Allow external recovery_config_directory

If required, recovery.conf can now be located outside of the data directory.
Server needs read/write permissions on this directory.
This commit is contained in:
Simon Riggs
2013-03-27 11:45:42 +00:00
parent f7f210b5c4
commit bc5334d867
7 changed files with 75 additions and 7 deletions

View File

@ -99,6 +99,25 @@ SetDataDir(const char *dir)
DataDir = new;
}
/*
* Set recovery config directory, but make sure it's an absolute path. Use this,
* never set RecoveryConfDir directly.
*/
void
SetRecoveryConfDir(const char *dir)
{
char *new;
AssertArg(dir);
/* If presented path is relative, convert to absolute */
new = make_absolute_path(dir);
if (RecoveryConfDir)
free(RecoveryConfDir);
RecoveryConfDir = new;
}
/*
* Change working directory to DataDir. Most of the postmaster and backend
* code assumes that we are in DataDir so it can use relative paths to access