Permalink
Browse files

Tweak `getTypename` to use the newer oid2typname function

  • Loading branch information...
lpsmith committed Jul 27, 2012
1 parent b70ae6a commit b58cbb1619c529b3bcd533016957c7c3e110fe5f
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/Database/PostgreSQL/Simple.hs
@@ -126,8 +126,7 @@ import qualified Data.IntMap as IntMap
import Data.List (intersperse)
import Data.Monoid (mappend, mconcat)
import Data.Typeable (Typeable)
-import Database.PostgreSQL.Simple.BuiltinTypes
- ( oid2builtin, builtin2typname )
+import Database.PostgreSQL.Simple.BuiltinTypes ( oid2typname )
import Database.PostgreSQL.Simple.Compat ( mask )
import Database.PostgreSQL.Simple.FromField (ResultError(..))
import Database.PostgreSQL.Simple.FromRow (FromRow(..))
@@ -934,8 +933,8 @@ fmtError msg q xs = throw FormatError {
getTypename :: Connection -> PQ.Oid -> IO ByteString
getTypename conn@Connection{..} oid =
- case oid2builtin oid of
- Just builtin -> return $! builtin2typname builtin
+ case oid2typname oid of
+ Just name -> return name
Nothing -> modifyMVar connectionObjects $ \oidmap -> do
case IntMap.lookup (oid2int oid) oidmap of
Just name -> return (oidmap, name)

0 comments on commit b58cbb1

Please sign in to comment.