pg_replslot will only exist in 9.4 and later

We need to clean this up regardless of whether "use_replication_slots"
is set.
This commit is contained in:
Ian Barwick
2015-11-30 15:40:43 +09:00
parent 5ccf89ad9b
commit 085b7cb8b4

View File

@@ -1795,14 +1795,17 @@ stop_backup:
* functionality of replication slots
*/
maxlen_snprintf(script, "rm -rf %s/pg_replslot/*",
local_data_directory);
r = system(script);
if (r != 0)
if (server_version_num >= 90400)
{
log_err(_("unable to empty replication slot directory %s/pg_replslot/\n"),
local_data_directory);
exit(ERR_BAD_RSYNC);
maxlen_snprintf(script, "rm -rf %s/pg_replslot/*",
local_data_directory);
r = system(script);
if (r != 0)
{
log_err(_("unable to empty replication slot directory %s/pg_replslot/\n"),
local_data_directory);
exit(ERR_BAD_RSYNC);
}
}
}