In my Java API server, I am using SERIALIZABLE transaction isolation mode, so I'm specially handling the error code of "40001 serialization_failure", which can occur often. I'm getting the error code String using SQLException's getSQLState() function.
Therefore I was surprised to see that the Java enum org.postgresql.util.PSQLState does not include this error code.