diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 100644
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1,6 @@
+# Revision history for tmp-proc-postgres
+
+## 0.5.0.0 -- 2021-09-28
+
+* First version. Extracted from an unreleased version of the tmp-proc library
+* Initial upload to hackage
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,30 @@
+Copyright (c) 2021, Tim Emiola
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of Tim Emiola nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/src/System/TmpProc/Docker/Postgres.hs b/src/System/TmpProc/Docker/Postgres.hs
new file mode 100644
--- /dev/null
+++ b/src/System/TmpProc/Docker/Postgres.hs
@@ -0,0 +1,120 @@
+{-# LANGUAGE DataKinds             #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE NamedFieldPuns        #-}
+{-# LANGUAGE OverloadedStrings     #-}
+{-# LANGUAGE ScopedTypeVariables   #-}
+{-# LANGUAGE TypeFamilies          #-}
+{-# OPTIONS_HADDOCK prune not-home #-}
+{-|
+Copyright   : (c) 2020-2021 Tim Emiola
+SPDX-License-Identifier: BSD3
+Maintainer  : Tim Emiola <adetokunbo@users.noreply.github.com >
+
+Provides an instance of 'Proc' that launches @postgres@ as a @tmp proc@.
+
+The instance this module provides can be used in integration tests as is.
+
+It's also possible to write other instances that launch @postgres@ in different
+ways; for those, this instance can be used as a reference example.
+
+-}
+module System.TmpProc.Docker.Postgres
+  ( -- * 'Proc' instance
+    TmpPostgres(..)
+
+    -- * Useful definitions
+  , aProc
+  , aHandle
+
+    -- * Re-exports
+  , module System.TmpProc
+  )
+where
+
+import           Control.Exception          (catch)
+import qualified Data.ByteString.Char8      as C8
+import           Data.String                (fromString)
+import           Data.Text                  (Text)
+import qualified Data.Text                  as Text
+
+import           Database.PostgreSQL.Simple (Connection, SqlError, close,
+                                             connectPostgreSQL, execute_)
+
+import           System.TmpProc             (Connectable (..), HList (..),
+                                             HandlesOf, HostIpAddress,
+                                             Pinged (..), Proc (..),
+                                             ProcHandle (..), SvcURI,
+                                             startupAll, withTmpConn)
+
+
+{-| A singleton 'HList' containing a 'TmpPostgres'. -}
+aProc :: HList '[TmpPostgres]
+aProc = TmpPostgres [] `HCons` HNil
+
+
+{-| An 'HList' that contains the handle created from 'aProc'. -}
+aHandle :: IO (HandlesOf '[TmpPostgres])
+aHandle = startupAll aProc
+
+
+{-| Provides the capability to launch a Postgres database as a @tmp proc@.
+
+The constructor receives the names of the tables to be dropped on 'reset'.
+
+-}
+data TmpPostgres = TmpPostgres [Text]
+
+
+{-| Specifies how to run @postgres@ as a @tmp proc@. -}
+instance Proc TmpPostgres where
+  type Image TmpPostgres = "postgres:10.6"
+  type Name TmpPostgres = "a-postgres-db"
+
+  uriOf = mkUri'
+  runArgs = runArgs'
+  ping = toPinged . connectPostgreSQL . hUri
+  reset = reset'
+
+{-| Specifies how to connect to a tmp @postgres@ db. -}
+instance Connectable TmpPostgres where
+  type Conn TmpPostgres = Connection
+
+  openConn = connectPostgreSQL . hUri
+  closeConn = close
+
+
+{-| Makes a uri whose password matches the one specified in 'runArgs''. -}
+mkUri' :: HostIpAddress -> SvcURI
+mkUri' ip = "host="
+             <> C8.pack (Text.unpack ip)
+             <> " dbname=postgres user=postgres password="
+             <> dbPassword
+             <> " port=5432"
+
+
+dbPassword :: C8.ByteString
+dbPassword = "mysecretpassword"
+
+
+{-| Match the password used in 'mkUri''. -}
+runArgs' :: [Text]
+runArgs' =
+  [ "-e"
+  , "POSTGRES_PASSWORD=" <> Text.pack (C8.unpack dbPassword)
+  ]
+
+
+toPinged :: IO a -> IO Pinged
+toPinged action = ((action >> pure OK)
+                    `catch` (\(_ :: SqlError) -> pure NotOK))
+                  `catch` (\(_ :: IOError) -> pure NotOK)
+
+
+
+{-| Empty all rows in the tables, if any are specified. -}
+reset' :: ProcHandle TmpPostgres -> IO ()
+reset' handle@(ProcHandle {hProc}) =
+  let go (TmpPostgres []) = pure ()
+      go (TmpPostgres tables) = withTmpConn handle $ \c ->
+        mapM_ (execute_ c . (fromString . (++) "DELETE FROM ") . Text.unpack) tables
+  in go hProc
diff --git a/test/Spec.hs b/test/Spec.hs
new file mode 100644
--- /dev/null
+++ b/test/Spec.hs
@@ -0,0 +1,12 @@
+module Main (main) where
+
+import           Test.Hspec
+
+import           System.IO
+import qualified Test.TmpProc.Docker.PostgresSpec as PG
+
+main :: IO ()
+main = do
+  hSetBuffering stdin NoBuffering
+  hSetBuffering stdout NoBuffering
+  hspec PG.spec
diff --git a/test/Test/TmpProc/Docker/PostgresSpec.hs b/test/Test/TmpProc/Docker/PostgresSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/Test/TmpProc/Docker/PostgresSpec.hs
@@ -0,0 +1,62 @@
+{-# LANGUAGE DataKinds         #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TypeApplications  #-}
+module Test.TmpProc.Docker.PostgresSpec where
+
+import           Test.Hspec
+import           Test.Hspec.TmpProc
+
+import           Control.Exception              (onException)
+import           Data.Proxy                     (Proxy (..))
+import           Data.Text                      (Text)
+import qualified Data.Text                      as Text
+import           Database.PostgreSQL.Simple     (execute_)
+
+import           System.TmpProc.Docker.Postgres
+
+
+spec :: Spec
+spec = tdescribe desc $ do
+  beforeAll setupHandles $ afterAll terminateAll $ do
+    context "when accessing from a list of other procs" $ do
+
+      context "ixPing" $ do
+
+        it "should succeed" $ \hs
+          -> ixPing @TmpPostgres Proxy hs `shouldReturn` OK
+
+      context "ixReset" $ do
+
+        it "should succeed when accessed by Name" $ \hs
+          -> ixReset @"a-postgres-db" Proxy hs `shouldReturn` ()
+
+        it "should succeed when accessed by Type" $ \hs
+          -> ixReset @TmpPostgres Proxy hs `shouldReturn` ()
+
+
+setupHandles :: IO (HList '[ProcHandle TmpPostgres])
+setupHandles = do
+  hs <- startupAll $ testProc `HCons` HNil
+  initTable hs `onException` terminateAll hs
+  pure hs
+
+
+testProc :: TmpPostgres
+testProc = TmpPostgres [testTable]
+
+
+testTable :: Text
+testTable = "to_be_reset"
+
+
+initTable :: HList '[ProcHandle TmpPostgres] -> IO ()
+initTable xs = withConnOf @TmpPostgres Proxy xs $ \c -> do
+  let commands =
+        [ "CREATE TABLE to_be_reset (an_id INTEGER)"
+        , "INSERT INTO to_be_reset VALUES (347)"
+        ]
+  mapM_ (execute_ c) commands
+
+
+desc :: String
+desc = "Tmp.Proc:Postgres:" ++ Text.unpack (nameOf testProc)
diff --git a/tmp-proc-postgres.cabal b/tmp-proc-postgres.cabal
new file mode 100644
--- /dev/null
+++ b/tmp-proc-postgres.cabal
@@ -0,0 +1,55 @@
+cabal-version:      3.0
+name:               tmp-proc-postgres
+version:            0.5.0.0
+synopsis:           Shows how to run a PostgreSQL database as a tmp proc
+description:
+  An example of using tmp-proc to launch dockerized PostgreSQL in integration tests.
+
+license:            BSD-3-Clause
+license-file:       LICENSE
+copyright:          2021 Tim Emiola
+author:             Tim Emiola
+maintainer:         adetokunbo@users.noreply.github.com
+category:           testing
+bug-reports:        https://github.com/adetokunbo/tmp-proc/issues
+build-type:         Simple
+extra-source-files:
+  ChangeLog.md
+tested-with:
+  GHC == 8.10.5
+
+source-repository head
+  type:     git
+  location: https://github.com/adetokunbo/tmp-proc.git
+
+library
+  exposed-modules:  System.TmpProc.Docker.Postgres
+  hs-source-dirs:   src
+  build-depends:
+    , base               >=4.11     && <4.16
+    , bytestring         >=0.10.8.2 && <0.12
+    , postgresql-simple  >=0.5.4.0  && <0.6.5
+    , text               ^>=1.2.3
+    , tmp-proc           >=0.5.0.0  && <0.6.0.0
+
+  default-language: Haskell2010
+  ghc-options:      -fno-ignore-asserts -Wall
+
+test-suite integration-test
+  type:             exitcode-stdio-1.0
+  main-is:          Spec.hs
+  other-modules:    Test.TmpProc.Docker.PostgresSpec
+  hs-source-dirs:   test
+  build-depends:
+    , base
+    , bytestring
+    , hspec
+    , hspec-tmp-proc
+    , postgresql-simple
+    , text
+    , tmp-proc
+    , tmp-proc-postgres
+
+  default-language: Haskell2010
+  ghc-options:
+    -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts -Wall
