standby clone: enable overwrite of existing data directory

But only if the --force is used, and the instance isn't active.
This commit is contained in:
Ian Barwick
2017-06-15 22:43:49 +09:00
parent b440b5fcb8
commit a69f80a9af

View File

@@ -1411,7 +1411,7 @@ check_source_server()
*/
if (mode == pg_basebackup)
{
if (is_pg_dir(local_data_directory))
if (is_pg_dir(local_data_directory) && runtime_options.force != true)
{
log_error(_("target data directory appears to be a PostgreSQL data directory"));
log_detail(_("target data directory is \"%s\""), local_data_directory);