diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
 Changelog for tmp-postgres
 
+1.16.1.0
+  #152 Add stopPostgresGracefully function.
+
 1.16.0.0
   #149 CopyDirectoryCommand partial and rename the old CopyDirectoryCommand to
   CompleteCopyDirectoryCommand.
diff --git a/src/Database/Postgres/Temp.hs b/src/Database/Postgres/Temp.hs
--- a/src/Database/Postgres/Temp.hs
+++ b/src/Database/Postgres/Temp.hs
@@ -60,6 +60,7 @@
   , stop
   , restart
   , stopPostgres
+  , stopPostgresGracefully
   , startNewDb
   , startNewDbConfig
   , stopNewDb
diff --git a/src/Database/Postgres/Temp/Internal.hs b/src/Database/Postgres/Temp/Internal.hs
--- a/src/Database/Postgres/Temp/Internal.hs
+++ b/src/Database/Postgres/Temp/Internal.hs
@@ -320,7 +320,7 @@
   dbResources@Resources {..} <-
     ContT $ bracketOnError (setupConfig extra) cleanupConfig
   dbPostgresProcess <-
-    ContT $ bracketOnError (startPlan resourcesPlan) stopPostgresProcess
+    ContT $ bracketOnError (startPlan resourcesPlan) stopPlan
   pure DB {..}
 
 -- | Default start behavior. Equivalent to calling 'startConfig' with the
@@ -336,7 +336,7 @@
 --   @since 1.12.0.0
 stop :: DB -> IO ()
 stop DB {..} = do
-  void $ stopPostgresProcess dbPostgresProcess
+  void $ stopPlan dbPostgresProcess
   cleanupConfig dbResources
 
 -- | Only stop the @postgres@ process but leave any temporary resources.
@@ -345,8 +345,16 @@
 --
 --   @since 1.12.0.0
 stopPostgres :: DB -> IO ExitCode
-stopPostgres = stopPostgresProcess . dbPostgresProcess
+stopPostgres = stopPlan . dbPostgresProcess
 
+-- | Only stop the @postgres@ process but leave any temporary resources.
+--   In contrast to 'stopPostgres' this function makes sure @postgres@
+--   has time to properly write files to the data directory.
+--
+--   @since 1.16.1.0
+stopPostgresGracefully :: DB -> IO ExitCode
+stopPostgresGracefully = stopPostgresProcess True . dbPostgresProcess
+
 -- | Restart the @postgres@ from 'DB' using the prior 'Plan'.
 --
 --   @since 1.12.0.0
@@ -356,7 +364,7 @@
   let CompletePlan{..} = resourcesPlan dbResources
       startAction = startPostgresProcess completePlanConnectionTimeout completePlanLogger
         completePlanPostgres
-  bracketOnError startAction stopPostgresProcess $ \result ->
+  bracketOnError startAction stopPlan $ \result ->
     pure $ db { dbPostgresProcess = result }
 
 -- | Reload the configuration file without shutting down. Calls
diff --git a/src/Database/Postgres/Temp/Internal/Core.hs b/src/Database/Postgres/Temp/Internal/Core.hs
--- a/src/Database/Postgres/Temp/Internal/Core.hs
+++ b/src/Database/Postgres/Temp/Internal/Core.hs
@@ -21,7 +21,7 @@
 import           System.Directory
 import           System.Exit (ExitCode(..))
 import           System.IO
-import           System.Posix.Signals (sigQUIT, signalProcess)
+import           System.Posix.Signals (sigINT, sigQUIT, signalProcess)
 import           System.Process
 import           System.Process.Internals
 import           System.Timeout
@@ -251,12 +251,12 @@
 
 -- | Stop the @postgres@ process after attempting to terminate all the
 --   connections.
-stopPostgresProcess :: PostgresProcess -> IO ExitCode
-stopPostgresProcess PostgresProcess{..} = do
+stopPostgresProcess :: Bool -> PostgresProcess -> IO ExitCode
+stopPostgresProcess graceful PostgresProcess{..} = do
   withProcessHandle postgresProcessHandle $ \case
     OpenHandle p   ->
       -- Call for "Immediate shutdown"
-      signalProcess sigQUIT p
+      signalProcess (if graceful then sigINT else sigQUIT) p
     OpenExtHandle {} -> pure () -- TODO log windows is not supported
     ClosedHandle _ -> return ()
 
@@ -273,7 +273,7 @@
         <$> startProcess "postgres" completePostgresPlanProcessConfig
 
   -- Start postgres and stop if an exception occurs
-  bracketOnError startAction stopPostgresProcess $
+  bracketOnError startAction (stopPostgresProcess False) $
     \result@PostgresProcess {..} -> do
       logger WaitForDB
       -- We assume that 'template1' exist and make connection
@@ -412,11 +412,11 @@
   let startAction = startPostgresProcess
         completePlanConnectionTimeout completePlanLogger completePlanPostgres
 
-  bracketOnError startAction stopPostgresProcess $ \result -> do
+  bracketOnError startAction (stopPostgresProcess False) $ \result -> do
     for_ completePlanCreateDb executeCreateDb
 
     pure result
 
 -- | Stop the @postgres@ process. See 'stopPostgresProcess' for more details.
 stopPlan :: PostgresProcess -> IO ExitCode
-stopPlan = stopPostgresProcess
+stopPlan = stopPostgresProcess False
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -717,7 +717,7 @@
         PG.query_ conn "SELECT id FROM foo ORDER BY id ASC"
           `shouldReturn` [PG.Only (1 :: Int), PG.Only 2]
 
-      stopPostgres db `shouldReturn` ExitSuccess
+      stopPostgresGracefully db `shouldReturn` ExitSuccess
 
       removeDirectoryRecursive dataDir
       createDirectory dataDir
diff --git a/tmp-postgres.cabal b/tmp-postgres.cabal
--- a/tmp-postgres.cabal
+++ b/tmp-postgres.cabal
@@ -1,5 +1,5 @@
 name:                tmp-postgres
-version:             1.16.0.0
+version:             1.16.1.0
 synopsis: Start and stop a temporary postgres
 description: Start and stop a temporary postgres. See README.md
 homepage:            https://github.com/jfischoff/tmp-postgres#readme
