Java's org.postgresql.util.PSQLState is missing common PostgreSQLError Codes - Mailing list pgsql-jdbc

From David Kremer
Subject Java's org.postgresql.util.PSQLState is missing common PostgreSQLError Codes
Date
Msg-id trinity-f7f59cc7-fa5b-4774-a4e9-5147da857899-1548882690659@3c-app-mailcom-bs06
Whole thread Raw
Responses Re: Java's org.postgresql.util.PSQLState is missing common PostgreSQLError Codes  (Jorge Solórzano <jorsol@gmail.com>)
List pgsql-jdbc
(resending to avoid HTML formatting)

In my Java API server, I am using SERIALIZABLE transaction isolation mode, so I'm specially handling the error code of
"40001serialization_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.

PSQLState code: https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/util/PSQLState.java
PSQLState documentation:
https://jdbc.postgresql.org/development/privateapi/org/postgresql/util/PSQLState.html[https://jdbc.postgresql.org/development/privateapi/org/postgresql/util/PSQLState.html]

The 40001 serialization_failure error is listed here:
https://www.postgresql.org/docs/11/errcodes-appendix.html[https://www.postgresql.org/docs/11/errcodes-appendix.html]

It seems like this should be added to the pgjdbc Java enum. Is there a reason it's not in there?


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: JDBC sometimes sends a parse message with only 2 of 21 parametertypes specified
Next
From: Jorge Solórzano
Date:
Subject: Re: Java's org.postgresql.util.PSQLState is missing common PostgreSQLError Codes