diff --git a/sqlx-postgres/src/options/pgpass.rs b/sqlx-postgres/src/options/pgpass.rs index 49da460daf..bf16559548 100644 --- a/sqlx-postgres/src/options/pgpass.rs +++ b/sqlx-postgres/src/options/pgpass.rs @@ -43,10 +43,20 @@ fn load_password_from_file( ) -> Option { let file = File::open(&path) .map_err(|e| { - tracing::warn!( - path = %path.display(), - "Failed to open `.pgpass` file: {e:?}", - ); + match e.kind() { + std::io::ErrorKind::NotFound => { + tracing::debug!( + path = %path.display(), + "`.pgpass` file not found", + ); + } + _ => { + tracing::warn!( + path = %path.display(), + "Failed to open `.pgpass` file: {e:?}", + ); + } + }; }) .ok()?;