git.iko.soy/typeable/postgresql-simple
on master help sign in
Added ExclusionViolation to ConstraintViolation
commit28d51757d43c7dda1a7ac0a7d78d726b4bbe8c83 authorJoão Cristóvão <jmacristovao@gmail.com> dateFri 24 Apr 2015, 21:35 (12 years ago) parent28d3676
1 file changed+3
src/Database/PostgreSQL/Simple/Errors.hs+3
src/Database/PostgreSQL/Simple/Errors.hs+3
@@ -55,6 +55,8 @@ data ConstraintViolation
5555 -- ^ Name of violated constraint
5656 | CheckViolation ByteString ByteString
5757 -- ^ Relation name (usually table), constraint name
58+ | ExclusionViolation ByteString
59+ -- ^ Name of the exclusion violation constraint
5860 deriving (Show, Eq, Ord, Typeable)
5961
6062-- Default instance should be enough
@@ -75,6 +77,7 @@ constraintViolation e =
7577 "23503" -> uncurry ForeignKeyViolation <$> parseMaybe parseQ2 msg
7678 "23505" -> UniqueViolation <$> parseMaybe parseQ1 msg
7779 "23514" -> uncurry CheckViolation <$> parseMaybe parseQ2 msg
80+ "23P01" -> ExclusionViolation <$> parseMaybe parseQ1 msg
7881 _ -> Nothing
7982 where msg = sqlErrorMsg e
8083