Re: Foreign key constraint & getErrorCode

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Ian Pilcher <i(dot)pilcher(at)comcast(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Foreign key constraint & getErrorCode
Date: 2004-09-10 22:43:46
Message-ID: 41422E22.1010104@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ian Pilcher 2004-09-11 02:33:41 Re: Foreign key constraint & getErrorCode
Previous Message Ian Pilcher 2004-09-10 15:49:02 Foreign key constraint & getErrorCode