diff --git a/src/sync.rs b/src/sync.rs index e8dbe2c..3684d27 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -56,6 +56,7 @@ pub(crate) fn database_config_is_local(config: &PostgresConfig) -> bool { .iter() .all(|address| address.is_loopback()) && config.get_hosts().iter().all(|host| match host { + #[cfg(unix)] Host::Unix(_) => true, Host::Tcp(name) => is_local_host(name), }) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 3ce2c8c..de0ea0b 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -31,6 +31,7 @@ pub fn database_hosts_are_local(config: &postgres::Config) -> bool { .iter() .all(|address| address.is_loopback()) && config.get_hosts().iter().all(|host| match host { + #[cfg(unix)] postgres::config::Host::Unix(_) => true, postgres::config::Host::Tcp(host) if host.eq_ignore_ascii_case("localhost") => true, postgres::config::Host::Tcp(host) => host