diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,14 @@
+## 0.3.1.1
+
+* Bump time to >= 1.5
+
 ## 0.3.1
 
 * SQL code generator escapes column names, so table column names can
   be the same as SQL keywords.
 * Add `like` operator
 * Add the types `PGCitext`, `PGArray`, `PGBytea`
-* 
-	
+
 ## 0.3
 
 * Replace `Default QueryRunner` with a new class `DefaultQueryRunnerColumn`, migrate with `s/Default QueryRunner/DefaultQueryRunnerColumn` and `s/def/queryRunnerColumnDefault/`
diff --git a/TODO.md b/TODO.md
--- a/TODO.md
+++ b/TODO.md
@@ -1,6 +1,11 @@
 # Low priority
 
-* General type families for improving instance resolution (product-profunctors)
+* General type families for improving instance resolution
+  (product-profunctors).  (Currently there are three places in Opaleye
+  where instance resolution needs to happen: `runQuery`,
+  `runInsertReturning` and `leftJoin`.  As it happens it seems
+  difficult to make any of these benefit from a general type family
+  approach.)
 
 ## Good starter projects for someone wanting to contribute to Opaleye
 
diff --git a/opaleye.cabal b/opaleye.cabal
--- a/opaleye.cabal
+++ b/opaleye.cabal
@@ -1,5 +1,5 @@
 name:            opaleye
-version:         0.3.1
+version:         0.3.1.1
 synopsis:        An SQL-generating DSL targeting PostgreSQL
 description:     An SQL-generating DSL targeting PostgreSQL.  Allows
                  Postgres queries to be written within Haskell in a
@@ -26,17 +26,18 @@
       -- Internal.RunQuery is merged upstream
       attoparsec          >= 0.10.3  && < 0.13
     , base                >= 4       && < 5
+    , base16-bytestring   >= 0.1.1.6 && < 0.2
     , case-insensitive    >= 1.2     && < 1.3
-    , contravariant       >= 0.4.4   && < 1.3
-    , old-locale          >= 1.0     && < 1.1
+    , bytestring          >= 0.10    && < 0.11
+    , contravariant       >= 0.4.4   && < 1.4
     , postgresql-simple   >= 0.4.8.0 && < 0.5
     , pretty              >= 1.1.1.0 && < 1.2
     , product-profunctors >= 0.5     && < 0.7
-    , profunctors         >= 4.0     && < 4.4
+    , profunctors         >= 4.0     && < 4.5
     , semigroups          >= 0.13    && < 0.17
     , text                >= 0.11    && < 1.3
     , transformers        >= 0.3     && < 0.5
-    , time                >= 1.4     && < 1.5
+    , time                >= 1.5     && < 1.6
     , uuid                >= 1.3     && < 1.4
   exposed-modules: Opaleye,
                    Opaleye.Aggregate,
diff --git a/src/Opaleye/Column.hs b/src/Opaleye/Column.hs
--- a/src/Opaleye/Column.hs
+++ b/src/Opaleye/Column.hs
@@ -11,7 +11,7 @@
 
 -- | A NULL of any type
 null :: Column (Nullable a)
-null = unsafeCoerce (C.Column (HPQ.ConstExpr HPQ.NullLit))
+null = C.Column (HPQ.ConstExpr HPQ.NullLit)
 
 isNull :: Column (Nullable a) -> Column T.PGBool
 isNull = C.unOp HPQ.OpIsNull
diff --git a/src/Opaleye/Internal/HaskellDB/PrimQuery.hs b/src/Opaleye/Internal/HaskellDB/PrimQuery.hs
--- a/src/Opaleye/Internal/HaskellDB/PrimQuery.hs
+++ b/src/Opaleye/Internal/HaskellDB/PrimQuery.hs
@@ -5,6 +5,7 @@
 module Opaleye.Internal.HaskellDB.PrimQuery where
 
 import qualified Opaleye.Internal.Tag as T
+import Data.ByteString (ByteString)
 
 type TableName  = String
 type Attribute  = String
@@ -31,6 +32,7 @@
 	     | DefaultLit            -- ^ represents a default value
 	     | BoolLit Bool
 	     | StringLit String
+             | ByteStringLit ByteString
 	     | IntegerLit Integer
 	     | DoubleLit Double
 	     | OtherLit String       -- ^ used for hacking in custom SQL
diff --git a/src/Opaleye/Internal/HaskellDB/Sql/Default.hs b/src/Opaleye/Internal/HaskellDB/Sql/Default.hs
--- a/src/Opaleye/Internal/HaskellDB/Sql/Default.hs
+++ b/src/Opaleye/Internal/HaskellDB/Sql/Default.hs
@@ -8,6 +8,9 @@
 import Opaleye.Internal.HaskellDB.Sql
 import Opaleye.Internal.HaskellDB.Sql.Generate
 import Opaleye.Internal.Tag (tagWith)
+import Data.ByteString (ByteString)
+import qualified Data.ByteString.Char8 as BS8
+import qualified Data.ByteString.Base16 as Base16
 
 mkSqlGenerator :: SqlGenerator -> SqlGenerator
 mkSqlGenerator gen = SqlGenerator 
@@ -169,6 +172,8 @@
       DefaultLit    -> "DEFAULT"
       BoolLit True  -> "TRUE"
       BoolLit False -> "FALSE"
+      ByteStringLit s
+                    -> binQuote s
       StringLit s   -> quote s
       IntegerLit i  -> show i
       DoubleLit d   -> show d
@@ -195,3 +200,8 @@
 escape '\t' = "\\t"
 escape '\\' = "\\\\"
 escape c = [c]
+
+
+-- | Quote binary literals using Postgresql's hex format.
+binQuote :: ByteString -> String
+binQuote s = "E'\\\\x" ++ BS8.unpack (Base16.encode s) ++ "'"
diff --git a/src/Opaleye/Internal/RunQuery.hs b/src/Opaleye/Internal/RunQuery.hs
--- a/src/Opaleye/Internal/RunQuery.hs
+++ b/src/Opaleye/Internal/RunQuery.hs
@@ -25,6 +25,8 @@
 import qualified Data.CaseInsensitive as CI
 import qualified Data.Text as ST
 import qualified Data.Text.Lazy as LT
+import qualified Data.ByteString as SBS
+import qualified Data.ByteString.Lazy as LBS
 import qualified Data.Time as Time
 import           Data.UUID (UUID)
 import           GHC.Int (Int64)
@@ -106,6 +108,12 @@
   queryRunnerColumnDefault = fieldQueryRunnerColumn
 
 instance QueryRunnerColumnDefault T.PGUuid UUID where
+  queryRunnerColumnDefault = fieldQueryRunnerColumn
+
+instance QueryRunnerColumnDefault T.PGBytea SBS.ByteString where
+  queryRunnerColumnDefault = fieldQueryRunnerColumn
+
+instance QueryRunnerColumnDefault T.PGBytea LBS.ByteString where
   queryRunnerColumnDefault = fieldQueryRunnerColumn
 
 instance QueryRunnerColumnDefault T.PGText ST.Text where
diff --git a/src/Opaleye/Operators.hs b/src/Opaleye/Operators.hs
--- a/src/Opaleye/Operators.hs
+++ b/src/Opaleye/Operators.hs
@@ -43,7 +43,6 @@
 (.>=) :: Column a -> Column a -> Column T.PGBool
 (.>=) = C.binOp HPQ.OpGtEq
 
--- For import order reasons we can't make the return type PGBool
 case_ :: [(Column T.PGBool, Column a)] -> Column a -> Column a
 case_ = unsafeCase_
 
diff --git a/src/Opaleye/PGTypes.hs b/src/Opaleye/PGTypes.hs
--- a/src/Opaleye/PGTypes.hs
+++ b/src/Opaleye/PGTypes.hs
@@ -10,9 +10,10 @@
 import qualified Data.CaseInsensitive as CI
 import qualified Data.Text as SText
 import qualified Data.Text.Lazy as LText
+import qualified Data.ByteString as SByteString
+import qualified Data.ByteString.Lazy as LByteString
 import qualified Data.Time as Time
 import qualified Data.UUID as UUID
-import qualified System.Locale as SL
 
 import           Data.Int (Int64)
 
@@ -31,6 +32,7 @@
 data PGUuid
 data PGCitext
 data PGArray a
+data PGBytea
 
 instance C.PGNum PGFloat8 where
   pgFromInteger = pgDouble . fromInteger
@@ -50,6 +52,12 @@
 pgString :: String -> Column PGText
 pgString = literalColumn . HPQ.StringLit
 
+pgLazyByteString :: LByteString.ByteString -> Column PGBytea
+pgLazyByteString = literalColumn . HPQ.ByteStringLit . LByteString.toStrict
+
+pgStrictByteString :: SByteString.ByteString -> Column PGBytea
+pgStrictByteString = literalColumn . HPQ.ByteStringLit
+
 pgStrictText :: SText.Text -> Column PGText
 pgStrictText = literalColumn . HPQ.StringLit . SText.unpack
 
@@ -78,7 +86,7 @@
                                      . HPQ.ConstExpr
                                      . HPQ.OtherLit
                                      . format
-  where format = Time.formatTime SL.defaultTimeLocale formatString
+  where format = Time.formatTime Time.defaultTimeLocale formatString
 
 pgDay :: Time.Day -> Column PGDate
 pgDay = unsafePgFormatTime "date" "'%F'"
