diff --git a/hasql.cabal b/hasql.cabal
--- a/hasql.cabal
+++ b/hasql.cabal
@@ -1,7 +1,7 @@
 name:
   hasql
 version:
-  0.19.2
+  0.19.3
 category:
   Hasql, Database, PostgreSQL
 synopsis:
diff --git a/library/Hasql/Encoders.hs b/library/Hasql/Encoders.hs
--- a/library/Hasql/Encoders.hs
+++ b/library/Hasql/Encoders.hs
@@ -29,6 +29,7 @@
   json,
   array,
   enum,
+  unknown,
   -- * Array
   Array,
   arrayValue,
@@ -320,6 +321,23 @@
 enum :: (a -> Text) -> Value a
 enum mapping =
   Value (Value.unsafePTI PTI.text (const (Encoder.enum mapping)))
+
+-- |
+-- Identifies the value with the PostgreSQL's \"unknown\" type,
+-- thus leaving it up to Postgres to infer the actual type of the value.
+-- 
+-- The bytestring needs to be encoded according to the Postgres\' binary format
+-- of the type it expects.
+-- 
+-- Essentially this is a low-level hook for encoding of values with custom codecs.
+-- The
+-- <http://hackage.haskell.org/package/postgresql-binary "postgresql-binary">
+-- library will provide you with the toolchain.
+-- 
+{-# INLINABLE unknown #-}
+unknown :: Value ByteString
+unknown =
+  Value (Value.unsafePTI PTI.unknown (const Encoder.bytea_strict))
 
 
 -- ** Instances
diff --git a/library/Hasql/PTI.hs b/library/Hasql/PTI.hs
--- a/library/Hasql/PTI.hs
+++ b/library/Hasql/PTI.hs
@@ -83,7 +83,7 @@
 tstzrange       = mkPTI 3910 (Just 3911)
 tsvector        = mkPTI 3614 (Just 3643)
 txid_snapshot   = mkPTI 2970 (Just 2949)
-unknown         = mkPTI 705  Nothing
+unknown         = mkPTI 705  (Just 705)
 uuid            = mkPTI 2950 (Just 2951)
 varbit          = mkPTI 1562 (Just 1563)
 varchar         = mkPTI 1043 (Just 1015)
