diff --git a/library/PostgreSQL/Binary/Decoder.hs b/library/PostgreSQL/Binary/Decoder.hs
--- a/library/PostgreSQL/Binary/Decoder.hs
+++ b/library/PostgreSQL/Binary/Decoder.hs
@@ -472,9 +472,12 @@
 array (ArrayDecoder decoder) =
   do
     dimensionsAmount <- intOfSize 4
-    unitOfSize (4 + 4)
-    dimensionSizes <- replicateM dimensionsAmount dimensionSize
-    decoder dimensionSizes
+    if dimensionsAmount /= 0
+      then do
+        unitOfSize (4 + 4)
+        dimensionSizes <- replicateM dimensionsAmount dimensionSize
+        decoder dimensionSizes
+      else decoder [0]
   where
     dimensionSize =
       intOfSize 4 <* unitOfSize 4
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.8.1
+  0.9
 synopsis:
   Encoders and decoders for the PostgreSQL's binary format
 description:
@@ -133,7 +133,7 @@
     conversion-text == 1.*,
     either == 4.*,
     transformers,
-    rebase >= 0.4 && < 0.5,
+    rebase >= 0.4 && < 2,
     base
 
 
