@@ -27,11 +27,11 @@ Note that the 'Float' and 'Double' instances use attoparsec's 'double'
2727conversion routine, which sacrifices some accuracy for speed. If you
2828need accuracy, consider first converting data to a 'Scientific' or 'Rational'
2929type, and then converting to a floating-point type. If you are defining
30−your own 'Database.PostgreSQL.Simple.FromRow.FromRow' instances, this can be
31−acheived simply by
32−@'fromRational' '<$>' 'Database.PostgreSQL.Simple.FromRow.field'@, although
30+your own 'Database.PostgreSQL.Simple.FromRow.FromRow' instances, this can be
31+acheived simply by
32+@'fromRational' '<$>' 'Database.PostgreSQL.Simple.FromRow.field'@, although
3333this idiom is additionally compatible with PostgreSQL's @numeric@ type.
34−If this is unacceptable, you may find
34+If this is unacceptable, you may find
3535'Database.PostgreSQL.Simple.FromRow.fieldWith' useful.
3636
3737Because 'FromField' is a typeclass, one may provide conversions to
@@ -104,12 +104,11 @@ module Database.PostgreSQL.Simple.FromField
104104
105105#include "MachDeps.h"
106106
107−import Control.Applicative
108− ( Applicative, (<|>), (<$>), pure )
107+import Control.Applicative ( (<|>), (<$>), pure )
109108import Control.Concurrent.MVar (MVar, newMVar)
110109import Control.Exception (Exception)
111110import qualified Data.Aeson as JSON
112−import Data.Attoparsec.Char8 hiding (Result)
111+import Data.Attoparsec.ByteString.Char8 hiding (Result)
113112import Data.ByteString (ByteString)
114113import qualified Data.ByteString.Char8 as B
115114import Data.Int (Int16, Int32, Int64)
@@ -492,7 +491,7 @@ instance FromField UUID where
492491-- | json
493492instance FromField JSON.Value where
494493 fromField f mbs =
495− if typeOid f /= $(inlineTypoid TI.json)
494+ if typeOid f /= $(inlineTypoid TI.json) && typeOid f /= $(inlineTypoid TI.jsonb)
496495 then returnError Incompatible f ""
497496 else case mbs of
498497 Nothing -> returnError UnexpectedNull f ""