@@ -241,6 +241,16 @@ instance FromField Bool where
241241 | bs == Just "f" = pure False
242242 | otherwise = returnError ConversionFailed f ""
243243
244+instance FromField Char where
245+ fromField f bs =
246+ if typeOid f /= typoid (TypeInfo.char)
247+ then returnError Incompatible f ""
248+ else case bs of
249+ Nothing -> returnError UnexpectedNull f ""
250+ Just bs -> if B.length bs /= 1
251+ then returnError ConversionFailed f "length not 1"
252+ else return $! (B.head bs)
253+
244254instance FromField Int16 where
245255 fromField = atto ok16 $ signed decimal
246256