diff --git a/hasql-th.cabal b/hasql-th.cabal
--- a/hasql-th.cabal
+++ b/hasql-th.cabal
@@ -1,5 +1,5 @@
 name: hasql-th
-version: 0.4.0.5
+version: 0.4.0.6
 category: Hasql, Database, PostgreSQL, Template Haskell
 synopsis: Template Haskell utilities for Hasql
 description:
diff --git a/library/Hasql/TH/Syntax/Parsing.hs b/library/Hasql/TH/Syntax/Parsing.hs
--- a/library/Hasql/TH/Syntax/Parsing.hs
+++ b/library/Hasql/TH/Syntax/Parsing.hs
@@ -1741,14 +1741,39 @@
 
 >>> testParser typecastTypename "int4?[][]"
 TypecastTypename (UnquotedIdent "int4") True 2 False
+
+>>> testParser typecastTypename "interval"
+TypecastTypename (UnquotedIdent "interval") False 0 False
+
+>>> testParser typecastTypename "time"
+TypecastTypename (UnquotedIdent "time") False 0 False
+
+>>> testParser typecastTypename "timestamp"
+TypecastTypename (UnquotedIdent "timestamp") False 0 False
+
+>>> testParser typecastTypename "timestamptz"
+TypecastTypename (UnquotedIdent "timestamptz") False 0 False
 -}
 typecastTypename = label "type" $ do
-  _baseName <- typeFunctionName
+  _baseName <- baseIdent
   endHead
   _baseNullable <- option False (True <$ space <* char '?')
   _arrayLevels <- fmap length $ many $ space *> char '[' *> endHead *> space *> char ']'
   _arrayNullable <- option False (True <$ space <* char '?')
   return (TypecastTypename _baseName _baseNullable _arrayLevels _arrayNullable)
+  where
+    {-
+    A custom derivation from definition of SimpleTypename,
+    wrapping up to a merger of "type_function_name" and "ConstInterval" and "ConstDatetime".
+    -}
+    baseIdent =
+      ident <|>
+      keywordNameFromSet set
+      where
+        set =
+          HashSet.unreservedKeyword <> HashSet.typeFuncNameKeyword <>
+          -- From defs of "ConstInterval" and "ConstDatetime":
+          HashSet.fromList ["interval", "timestamp", "time"]
 
 
 -- * Clauses
