@@ -75,15 +75,18 @@ doCopy :: B.ByteString -> Connection -> Query -> B.ByteString -> IO ()
7575doCopy funcName conn template q = do
7676 result <- exec conn q
7777 status <- PQ.resultStatus result
78− let err = throwIO $ QueryError
79− (B.unpack funcName ++ " " ++ show status)
78+ let errMsg msg = throwIO $ QueryError
79+ (B.unpack funcName ++ " " ++ msg)
8080 template
81+ let err = errMsg $ show status
8182 case status of
8283 PQ.EmptyQuery -> err
8384 PQ.CommandOk -> err
8485 PQ.TuplesOk -> err
8586 PQ.CopyOut -> return ()
8687 PQ.CopyIn -> return ()
88+ PQ.CopyBoth -> errMsg "COPY BOTH is not supported"
89+ PQ.SingleTuple -> errMsg "single-row mode is not supported"
8790 PQ.BadResponse -> throwResultError funcName result status
8891 PQ.NonfatalError -> throwResultError funcName result status
8992 PQ.FatalError -> throwResultError funcName result status