diff --git a/library/PostgreSQL/Binary/Encoder.hs b/library/PostgreSQL/Binary/Encoder.hs
--- a/library/PostgreSQL/Binary/Encoder.hs
+++ b/library/PostgreSQL/Binary/Encoder.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 module PostgreSQL.Binary.Encoder
 (
   run,
@@ -220,8 +221,13 @@
 
 {-# INLINABLE json #-}
 json :: Encoder Aeson.Value
+#if MIN_VERSION_aeson(0,10,0)
 json =
   Aeson.fromEncoding . Aeson.toEncoding
+#else
+json =
+  Builder.lazyByteString . Aeson.encode
+#endif
 
 
 -- * Text
diff --git a/postgresql-binary.cabal b/postgresql-binary.cabal
--- a/postgresql-binary.cabal
+++ b/postgresql-binary.cabal
@@ -1,7 +1,7 @@
 name:
   postgresql-binary
 version:
-  0.7.5
+  0.7.5.1
 synopsis:
   Encoders and decoders for the PostgreSQL's binary format
 description:
