diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+## 2.5.0.2
+
+* Fix lstat workaround for https://ghc.haskell.org/trac/ghc/ticket/7072 on Mac OS X [#564](https://github.com/yesodweb/persistent/pull/564)
+
 ## 2.5.0.1
 
 * Reapply workaround for https://ghc.haskell.org/trac/ghc/ticket/7072 [#561](https://github.com/yesodweb/persistent/pull/561)
diff --git a/cbits/sqlite3.c b/cbits/sqlite3.c
# file too large to diff: cbits/sqlite3.c
diff --git a/persistent-sqlite.cabal b/persistent-sqlite.cabal
--- a/persistent-sqlite.cabal
+++ b/persistent-sqlite.cabal
@@ -1,5 +1,5 @@
 name:            persistent-sqlite
-version:         2.5.0.1
+version:         2.5.0.2
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -65,6 +65,8 @@
                 , persistent
                 , persistent-sqlite
                 , persistent-template
+                , temporary
+                , text
                 , time
                 , transformers
 
diff --git a/test/Spec.hs b/test/Spec.hs
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -8,10 +8,14 @@
 {-# LANGUAGE TypeFamilies               #-}
 
 import Control.Monad.IO.Class  (liftIO)
+import qualified Data.Text as T
 import Data.Time
 import Database.Persist.Sqlite
 import Database.Persist.TH
+import qualified Database.Sqlite as Sqlite
 import Test.Hspec
+import System.IO (hClose)
+import System.IO.Temp (withSystemTempFile)
 
 share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
 Test
@@ -34,3 +38,8 @@
         tid <- insert $ Test now
         Just (Test now') <- get tid
         liftIO $ now' `shouldBe` now
+    it "issue #564" $ asIO $ withSystemTempFile "test564.sqlite3"$ \fp h -> do
+        hClose h
+        conn <- Sqlite.open (T.pack fp)
+        Sqlite.close conn
+        return ()
