diff --git a/cbits/noticehandlers.c b/cbits/noticehandlers.c
--- a/cbits/noticehandlers.c
+++ b/cbits/noticehandlers.c
@@ -56,4 +56,5 @@
     free(x);
     x = nx;
   }
+  free(arg);
 }
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.9.1.1
+Version:             0.9.2.0
 Synopsis:            low-level binding to libpq
 
 Description:         This is a binding to libpq: the C application
@@ -32,7 +32,7 @@
   c-sources:           cbits/noticehandlers.c
   include-dirs:        cbits
   Exposed-modules:     Database.PostgreSQL.LibPQ
-
+                       Database.PostgreSQL.LibPQ.Internal
   Build-depends:       base >= 4 && < 5
                      , bytestring
 
@@ -54,4 +54,4 @@
 source-repository this
   type:     git
   location: http://github.com/lpsmith/postgresql-libpq
-  tag:      v0.9.1.1
+  tag:      v0.9.2.0
diff --git a/src/Database/PostgreSQL/LibPQ.hsc b/src/Database/PostgreSQL/LibPQ.hsc
--- a/src/Database/PostgreSQL/LibPQ.hsc
+++ b/src/Database/PostgreSQL/LibPQ.hsc
@@ -165,6 +165,7 @@
     , isBusy
     , setnonblocking
     , isnonblocking
+    , setSingleRowMode
     , FlushStatus(..)
     , flush
 
@@ -244,6 +245,8 @@
 
 import Data.Typeable
 
+import Database.PostgreSQL.LibPQ.Internal
+
 #if __GLASGOW_HASKELL__ >= 700
 import Control.Exception (mask_)
 #else
@@ -261,16 +264,6 @@
 -- whether a connection was successfully made before queries are sent
 -- via the connection object.
 
--- | 'Connection' encapsulates a connection to the backend.
-data Connection = Conn {-# UNPACK #-} !(ForeignPtr PGconn)
-                       {-# UNPACK #-} !(MVar NoticeBuffer)
-
-instance Eq Connection where
-    (Conn c _) == (Conn d _) = c == d
-    (Conn c _) /= (Conn d _) = c /= d
-
-data PGconn
-
 -- | Makes a new connection to the database server.
 --
 -- This function opens a new database connection using the parameters
@@ -972,6 +965,10 @@
                 | NonfatalError -- ^ A nonfatal error (a notice or
                                 -- warning) occurred.
                 | FatalError    -- ^ A fatal error occurred.
+                | SingleTuple   -- ^ The PGresult contains a single result tuple
+                                -- from the current command. This status occurs
+                                -- only when single-row mode has been selected
+                                -- for the query.
                   deriving (Eq, Show)
 
 instance Enum ExecStatus where
@@ -983,6 +980,7 @@
     toEnum (#const PGRES_BAD_RESPONSE)   = BadResponse
     toEnum (#const PGRES_NONFATAL_ERROR) = NonfatalError
     toEnum (#const PGRES_FATAL_ERROR)    = FatalError
+    toEnum (#const PGRES_SINGLE_TUPLE)   = SingleTuple
     toEnum _ = error "Database.PQ.Enum.ExecStatus.toEnum: bad argument"
 
     fromEnum EmptyQuery    = (#const PGRES_EMPTY_QUERY)
@@ -993,6 +991,7 @@
     fromEnum BadResponse   = (#const PGRES_BAD_RESPONSE)
     fromEnum NonfatalError = (#const PGRES_NONFATAL_ERROR)
     fromEnum FatalError    = (#const PGRES_FATAL_ERROR)
+    fromEnum SingleTuple   = (#const PGRES_SINGLE_TUPLE)
 
 -- | Returns the result status of the command.
 resultStatus :: Result
@@ -1807,6 +1806,19 @@
 isnonblocking connection = enumFromConn connection c_PQisnonblocking
 
 
+-- | Select single-row mode for the currently-executing query.
+--
+-- This function can only be called immediately after PQsendQuery or one of its
+-- sibling functions, before any other operation on the connection such as
+-- PQconsumeInput or PQgetResult. If called at the correct time, the function
+-- activates single-row mode for the current query and returns 1. Otherwise the
+-- mode stays unchanged and the function returns 0. In any case, the mode
+-- reverts to normal after completion of the current query.
+setSingleRowMode :: Connection
+                 -> IO Bool
+setSingleRowMode connection = enumFromConn connection c_PQsetSingleRowMode
+
+
 data FlushStatus = FlushOk
                  | FlushFailed
                  | FlushWriting
@@ -2001,12 +2013,6 @@
     enumFromConn connection $ \p ->
         c_PQsetErrorVerbosity p $ fromIntegral $ fromEnum verbosity
 
-withConn :: Connection
-         -> (Ptr PGconn -> IO b)
-         -> IO b
-withConn (Conn !fp _) f = withForeignPtr fp f
-
-
 enumFromConn :: (Integral a, Enum b) => Connection
              -> (Ptr PGconn -> IO a)
              -> IO b
@@ -2086,9 +2092,6 @@
 --     where
 --       finalizer = touchForeignPtr fp
 
-data CNoticeBuffer
-type NoticeBuffer = Ptr CNoticeBuffer
-
 type NoticeReceiver = NoticeBuffer -> Ptr PGresult -> IO ()
 
 data PGnotice
@@ -2476,6 +2479,9 @@
 
 foreign import ccall unsafe "libpq-fe.h PQisnonblocking"
     c_PQisnonblocking :: Ptr PGconn -> IO CInt
+
+foreign import ccall unsafe "libpq-fe.h PQsetSingleRowMode"
+    c_PQsetSingleRowMode :: Ptr PGconn -> IO CInt
 
 foreign import ccall        "libpq-fe.h PQgetResult"
     c_PQgetResult :: Ptr PGconn -> IO (Ptr PGresult)
diff --git a/src/Database/PostgreSQL/LibPQ/Internal.hs b/src/Database/PostgreSQL/LibPQ/Internal.hs
new file mode 100644
--- /dev/null
+++ b/src/Database/PostgreSQL/LibPQ/Internal.hs
@@ -0,0 +1,39 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Database.PostgreSQL.LibPQ.Internal
+-- Copyright   :  (c) 2010 Grant Monroe,
+--                (c) 2011 Leon P Smith
+-- License     :  BSD3
+--
+-- This module exports the data constructor for the database connection
+-- object so that people may create their own foreign bindings to libpq
+-- functions that may not exist yet in vanilla postgresql-libpq.
+--
+-----------------------------------------------------------------------------
+
+{-# LANGUAGE BangPatterns, EmptyDataDecls #-}
+
+module Database.PostgreSQL.LibPQ.Internal where
+
+import Foreign
+import Control.Concurrent.MVar ( MVar )
+
+
+-- | 'Connection' encapsulates a connection to the backend.
+data Connection = Conn {-# UNPACK #-} !(ForeignPtr PGconn)
+                       {-# UNPACK #-} !(MVar NoticeBuffer)
+
+instance Eq Connection where
+    (Conn c _) == (Conn d _) = c == d
+    (Conn c _) /= (Conn d _) = c /= d
+
+withConn :: Connection
+         -> (Ptr PGconn -> IO b)
+         -> IO b
+withConn (Conn !fp _) f = withForeignPtr fp f
+{-# INLINE withConn #-}
+
+data PGconn
+
+data CNoticeBuffer
+type NoticeBuffer = Ptr CNoticeBuffer
