diff --git a/Database/PostgreSQL/LibPQ.hsc b/Database/PostgreSQL/LibPQ.hsc
--- a/Database/PostgreSQL/LibPQ.hsc
+++ b/Database/PostgreSQL/LibPQ.hsc
@@ -1,6 +1,6 @@
 -----------------------------------------------------------------------------
 -- |
--- Module      :  Database.PQ
+-- Module      :  Database.PostgreSQL.LibPQ
 -- Copyright   :  (c) 2010 Grant Monroe,
 --                (c) 2011 Leon P Smith
 -- License     :  BSD3
@@ -101,6 +101,7 @@
     , resultErrorMessage
     , FieldCode(..)
     , resultErrorField
+    , unsafeFreeResult
 
     -- * Retrieving Query Result Information
     -- $queryresultinfo
@@ -375,7 +376,7 @@
     = PollingFailed
     | PollingReading
     | PollingWriting
-    | PollingOk deriving Show
+    | PollingOk deriving (Eq, Show)
 
 pollHelper :: (Ptr PGconn -> IO CInt)
            -> Connection
@@ -466,7 +467,7 @@
     | ConnectionSetEnv             -- ^ Negotiating environment-driven
                                    -- parameter settings.
     | ConnectionSSLStartup         -- ^ Negotiating SSL encryption.
-      deriving Show
+      deriving (Eq, Show)
 
 
 -- | Returns the status of the connection.
@@ -905,7 +906,7 @@
                 | NonfatalError -- ^ A nonfatal error (a notice or
                                 -- warning) occurred.
                 | FatalError    -- ^ A fatal error occurred.
-                  deriving Show
+                  deriving (Eq, Show)
 
 instance Enum ExecStatus where
     toEnum (#const PGRES_EMPTY_QUERY)    = EmptyQuery
@@ -951,7 +952,19 @@
                    -> IO (Maybe B.ByteString)
 resultErrorMessage = flip maybeBsFromResult c_PQresultErrorMessage
 
+-- | Frees the memory associated with a result.  Note that using this
+-- function correctly is especially tricky;  you need to ensure that
+-- no references to the result.   This means no references to a value
+-- returned by 'getvalue',  no references hiding inside an unevaluated
+-- thunk,  etc.    Improper use of this function is likely to cause a
+-- segfault.   Also,  the use of this function is not strictly necessary;
+-- the memory will get freed by the garbage collector when there are no
+-- more references to the result.
 
+unsafeFreeResult :: Result -> IO ()
+unsafeFreeResult (Result x) = finalizeForeignPtr x
+
+
 data FieldCode = DiagSeverity
                -- ^ The severity; the field contents are ERROR, FATAL,
                -- or PANIC (in an error message), or WARNING, NOTICE,
@@ -1741,7 +1754,7 @@
 
 -- | Contains the information needed to cancel a command issued
 -- through a particular database connection.
-newtype Cancel = Cancel (ForeignPtr PGcancel) deriving Eq
+newtype Cancel = Cancel (ForeignPtr PGcancel) deriving (Eq, Show)
 data PGcancel
 
 
@@ -1880,7 +1893,7 @@
 
 data Verbosity = ErrorsTerse
                | ErrorsDefault
-               | ErrorsVerbose deriving (Show, Eq)
+               | ErrorsVerbose deriving (Eq, Show)
 
 instance Enum Verbosity where
     toEnum (#const PQERRORS_TERSE)   = ErrorsTerse
diff --git a/postgresql-libpq.cabal b/postgresql-libpq.cabal
--- a/postgresql-libpq.cabal
+++ b/postgresql-libpq.cabal
@@ -1,5 +1,5 @@
 Name:                postgresql-libpq
-Version:             0.6
+Version:             0.6.1
 Synopsis:            low-level binding to libpq
 
 Description:         This is a binding to libpq: the C application
@@ -39,4 +39,4 @@
 source-repository this
   type:     git
   location: http://github.com/lpsmith/postgresql-libpq
-  tag:      v0.6
+  tag:      v0.6.1
