@@ -34,6 +34,7 @@ module Database.PostgreSQL.Simple.FromField
36 , typename
36 , typename
38 , tableOid
39 , tableOid
39 , tableColumn
40 , tableColumn
@@ -139,8 +140,11 @@ class FromField a where
139-- meta-schema.
140-- meta-schema.
141typename :: Field -> Conversion ByteString
142typename :: Field -> Conversion ByteString
143+typename field = typname . typ <$> typeinfo field
145+typeinfo :: Field -> Conversion TypeInfo
142−typename field = Conversion $ \conn -> do
146+typeinfo Field{..} = Conversion $ \conn -> do
143− Ok . typname . typ <$> getTypeInfo conn (typeOid field)
147+ Ok <$> (getTypeInfo conn =<< PQ.ftype result column)
145-- | Returns the name of the column. This is often determined by a table
149-- | Returns the name of the column. This is often determined by a table
146-- definition, but it can be set using an @as@ clause.
150-- definition, but it can be set using an @as@ clause.