diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Changelog
 
+### 2.3.2.7
+
+* Compatibility with time 1.9 & GHC 8.8
+* Custom setup for cabal v2 & v3
+
 ### 2.3.2.6
 
 * Fix postgresql header name collision
diff --git a/HDBC-postgresql.cabal b/HDBC-postgresql.cabal
--- a/HDBC-postgresql.cabal
+++ b/HDBC-postgresql.cabal
@@ -1,5 +1,5 @@
 Name: HDBC-postgresql
-Version: 2.3.2.6
+Version: 2.3.2.7
 License: BSD3
 Maintainer: Nicolas Wu <nicolas.wu@gmail.com>
 Author: John Goerzen
@@ -20,6 +20,9 @@
 Build-Type: Custom
 Cabal-Version: >=1.8
 
+custom-setup
+  setup-depends: Cabal >= 1.8 && < 3.1, base < 5
+
 Flag splitBase
   description: Choose the new smaller, split-up package.
 Flag buildtests
@@ -43,7 +46,7 @@
   Build-Depends: base >= 3 && < 5, mtl, HDBC>=2.2.0, parsec, utf8-string,
                  bytestring, old-time, convertible
   if flag(minTime15)
-    Build-Depends: time >= 1.5 && < 1.9
+    Build-Depends: time >= 1.5 && < 1.10
     CPP-Options: -DMIN_TIME_15
   else
     Build-Depends: time < 1.5, old-locale
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -45,9 +45,9 @@
     constOrId x = liftM (fmap (\x -> (x, []))) . const x
 
 pgconfigProgram = (simpleProgram "pgconfig or pg_config") {
-    programFindLocation = \verbosity -> constOrId $ do
-      pgconfig  <- findProgramLocation verbosity "pgconfig"
-      pg_config <- findProgramLocation verbosity "pg_config"
+    programFindLocation = \verbosity searchPath -> do
+      pgconfig  <- findProgramOnSearchPath verbosity searchPath "pgconfig"
+      pg_config <- findProgramOnSearchPath verbosity searchPath "pg_config"
       return (pgconfig `mplus` pg_config)
   }
 
@@ -55,7 +55,7 @@
 psqlBuildInfo lbi = do
   (pgconfigProg, _) <- requireProgram verbosity
                          pgconfigProgram (withPrograms lbi)
-  let pgconfig = rawSystemProgramStdout verbosity pgconfigProg
+  let pgconfig = getProgramOutput verbosity pgconfigProg
 
   incDir <- pgconfig ["--includedir"]
   libDir <- pgconfig ["--libdir"]
