We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf134aa commit 7d07d3eCopy full SHA for 7d07d3e
1 file changed
src/Database/PostgreSQL/Simple/FromField.hs
@@ -298,16 +298,16 @@ instance FromField Bool where
298
| bs == Just "f" = pure False
299
| otherwise = returnError ConversionFailed f ""
300
301
--- | \"char\"
+-- | \"char\", bpchar
302
instance FromField Char where
303
fromField f bs =
304
- if typeOid f /= $(inlineTypoid TI.char)
305
- then returnError Incompatible f ""
306
- else case bs of
+ if $(mkCompats [TI.char,TI.bpchar]) (typeOid f)
+ then case bs of
307
Nothing -> returnError UnexpectedNull f ""
308
Just bs -> if B.length bs /= 1
309
then returnError ConversionFailed f "length not 1"
310
else return $! (B.head bs)
+ else returnError Incompatible f ""
311
312
-- | int2
313
instance FromField Int16 where
0 commit comments