Index: tokio-postgres/Cargo.toml
===================================================================
--- tokio-postgres.orig/Cargo.toml
+++ tokio-postgres/Cargo.toml
@@ -93,7 +93,7 @@ version = "0.6.8"
 version = "0.2.9"
 
 [dependencies.rand]
-version = "0.9.0"
+version = ">= 0.8.5, < 0.10"
 
 [dependencies.tokio]
 version = "1.27"
Index: tokio-postgres/src/connect.rs
===================================================================
--- tokio-postgres.orig/src/connect.rs
+++ tokio-postgres/src/connect.rs
@@ -44,7 +44,7 @@ where
 
     let mut indices = (0..num_hosts).collect::<Vec<_>>();
     if config.load_balance_hosts == LoadBalanceHosts::Random {
-        indices.shuffle(&mut rand::rng());
+        indices.shuffle(&mut rand::thread_rng());
     }
 
     let mut error = None;
@@ -101,7 +101,7 @@ where
                 .collect::<Vec<_>>();
 
             if config.load_balance_hosts == LoadBalanceHosts::Random {
-                addrs.shuffle(&mut rand::rng());
+                addrs.shuffle(&mut rand::thread_rng());
             }
 
             let mut last_err = None;
