diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2013-03-27 11:45:42 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2013-03-27 11:45:42 +0000 |
commit | bc5334d8679c428a709d150666b288171795bd76 (patch) | |
tree | fc964f441b4dd08a483987762771c936bcaf7959 /src/backend/utils/misc/guc.c | |
parent | f7f210b5c4c9c76e87fffc5abef7dea752d1ac9a (diff) |
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.
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 22ba35fef93..0459dd1c09b 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -424,6 +424,7 @@ int temp_file_limit = -1; int num_temp_buffers = 1024; char *data_directory; +char *recovery_config_directory; char *ConfigFileName; char *HbaFileName; char *IdentFileName; @@ -2961,6 +2962,17 @@ static struct config_string ConfigureNamesString[] = }, { + {"recovery_config_directory", PGC_POSTMASTER, FILE_LOCATIONS, + gettext_noop("Sets the server's recovery configuration directory."), + NULL, + GUC_SUPERUSER_ONLY + }, + &recovery_config_directory, + NULL, + NULL, NULL, NULL + }, + + { {"config_file", PGC_POSTMASTER, FILE_LOCATIONS, gettext_noop("Sets the server's main configuration file."), NULL, @@ -4182,6 +4194,18 @@ SelectConfigFiles(const char *userDoption, const char *progname) SetConfigOption("data_directory", DataDir, PGC_POSTMASTER, PGC_S_OVERRIDE); /* + * If the recovery_config_directory GUC variable has been set, use that, + * otherwise use DataDir. + * + * Note: SetRecoveryConfDir will copy and absolute-ize its argument, + * so we don't have to. + */ + if (recovery_config_directory) + SetRecoveryConfDir(recovery_config_directory); + else + SetRecoveryConfDir(DataDir); + + /* * If timezone_abbreviations wasn't set in the configuration file, install * the default value. We do it this way because we can't safely install a * "real" value until my_exec_path is set, which may not have happened |