Re: Foreign key constraint & getErrorCode - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Foreign key constraint & getErrorCode
Date
Msg-id 41422E22.1010104@opencloud.com
Whole thread Raw
In response to Foreign key constraint & getErrorCode  (Ian Pilcher <i.pilcher@comcast.net>)
Responses Re: Foreign key constraint & getErrorCode
List pgsql-jdbc
Ian Pilcher wrote:

> Based on my reading of the PostgreSQL docs, getErrorCode should be
> returning 23503.  Any idea what's going on?

Try SQLException.getSQLState() instead. The backend returns (somewhat
standardized) alphanumeric SQL states with errors and the driver exposes
these as via getSQLState(). getErrorCode() is numeric, vendor-specific,
and unused by the current driver.

You may also need to upgrade your JDBC driver; I don't know how recent
the driver in the RPMs you are using is.

-O

pgsql-jdbc by date:

Previous
From: Ian Pilcher
Date:
Subject: Foreign key constraint & getErrorCode
Next
From: Ian Pilcher
Date:
Subject: Re: Foreign key constraint & getErrorCode