Java's org.postgresql.util.PSQLState is missing common PostgreSQL Error Codes

From: "David Kremer" <jkorders(at)gmx(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Java's org.postgresql.util.PSQLState is missing common PostgreSQL Error Codes
Date: 2019-01-30 21:10:32
Message-ID: trinity-54fd3756-26b8-4e4e-b444-751484a9f8d4-1548882632489@3c-app-mailcom-bs06
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>In my Java API server, I am using SERIALIZABLE transaction isolation mode, so I&#39;m specially handling the error code of &quot;40001 serialization_failure&quot;, which can occur often. I&#39;m getting the error code String using SQLException&#39;s getSQLState() function.<br/>
<br/>
Therefore I was surprised to see that the Java enum org.postgresql.util.PSQLState does not include this error code.<br/>
<br/>
PSQLState code: <a href="https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/util/PSQLState.java" target="_blank">https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/util/PSQLState.java</a><br/>
PSQLState documentation: <a href="https://jdbc.postgresql.org/development/privateapi/org/postgresql/util/PSQLState.html" target="_blank">https://jdbc.postgresql.org/development/privateapi/org/postgresql/util/PSQLState.html</a><br/>
<br/>
The 40001 serialization_failure error is listed here: <a href="https://www.postgresql.org/docs/11/errcodes-appendix.html" target="_blank">https://www.postgresql.org/docs/11/errcodes-appendix.html</a><br/>
<br/>
It seems like this should be added to the pgjdbc Java enum. Is there a reason it&#39;s not in there?</div></div></body></html>

Attachment Content-Type Size
unknown_filename text/html 1.3 KB

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Kremer 2019-01-30 21:11:30 Java's org.postgresql.util.PSQLState is missing common PostgreSQL Error Codes
Previous Message Dave Cramer 2019-01-28 14:26:57 Re: JDBC sometimes sends a parse message with only 2 of 21 parameter types specified