@@ -110,7 +110,7 @@ import Blaze.ByteString.Builder.Char8 (fromChar)
110110import Control.Applicative ((<$>), pure)
111111import Control.Concurrent.MVar
112112import Control.Exception
113− ( Exception, bracket, onException, throw, throwIO, finally )
113+ ( Exception, onException, throw, throwIO, finally )
114114import Control.Monad (foldM)
115115import Data.ByteString (ByteString)
116116import Data.Char(ord)
@@ -121,6 +121,7 @@ import Data.Monoid (mappend, mconcat)
121121import Data.Typeable (Typeable)
122122import Database.PostgreSQL.Simple.BuiltinTypes
123123 ( oid2builtin, builtin2typname )
124+import Database.PostgreSQL.Simple.Compat ( mask )
124125import Database.PostgreSQL.Simple.FromField (ResultError(..))
125126import Database.PostgreSQL.Simple.FromRow (FromRow(..))
126127import Database.PostgreSQL.Simple.Ok
@@ -133,7 +134,6 @@ import qualified Database.PostgreSQL.LibPQ as PQ
133134import Text.Regex.PCRE.Light (compile, caseless, match)
134135import qualified Data.ByteString.Char8 as B
135136import qualified Data.Vector as V
136−import Control.Exception
137137import Control.Monad.Trans.Reader
138138import Control.Monad.Trans.State.Strict
139139
@@ -471,7 +471,7 @@ finishQuery conn q result = do
471471 throwIO $ QueryError "query resulted in a command response" q
472472 PQ.TuplesOk -> do
473473 ncols <- PQ.nfields result
474− let unCol (PQ.Col x) = fromIntegral x
474+ let unCol (PQ.Col x) = fromIntegral x :: Int
475475 typenames <- V.generateM (unCol ncols)
476476 (\(PQ.Col . fromIntegral -> col) -> do
477477 getTypename conn =<< PQ.ftype result col)
@@ -500,24 +500,6 @@ ellipsis bs
500500 | B.length bs > 15 = B.take 10 bs `B.append` "[...]"
501501 | otherwise = bs
502502
503−-- | Throw a 'ConversionFailed' exception, indicating a mismatch
504−-- between the number of columns in the 'Field' and row, and the
505−-- number in the collection to be converted to.
506−convertError :: [Field]
507− -- ^ Descriptors of fields to be converted.
508− -> [Maybe ByteString]
509− -- ^ Contents of the row to be converted.
510− -> Int
511− -- ^ Number of columns expected for conversion. For
512− -- instance, if converting to a 3-tuple, the number to
513− -- provide here would be 3.
514− -> Either SomeException a
515−convertError fs vs n = Left . SomeException $ ConversionFailed
516− (show (length fs) ++ " values: " ++ show (zip (map typename fs)
517− (map (fmap ellipsis) vs)))
518− (show n ++ " slots in target type")
519− "mismatch between number of columns to convert and number in target type"
520−
521503
522504-- | Of the four isolation levels defined by the SQL standard,
523505-- these are the three levels distinguished by PostgreSQL as of version 9.0.