File tree Expand file tree Collapse file tree
src/Database/PostgreSQL/Simple Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -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
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ finishQueryWith parser conn q result = do
4545 throwIO $ QueryError " query: COPY TO is not supported" q
4646 PQ. CopyIn ->
4747 throwIO $ QueryError " query: COPY FROM is not supported" q
48+ PQ. CopyBoth ->
49+ throwIO $ QueryError " query: COPY BOTH is not supported" q
50+ PQ. SingleTuple ->
51+ throwIO $ QueryError " query: single-row mode is not supported" q
4852 PQ. BadResponse -> throwResultError " query" result status
4953 PQ. NonfatalError -> throwResultError " query" result status
5054 PQ. FatalError -> throwResultError " query" result status
You can’t perform that action at this time.
0 commit comments