pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Ian Pilcher <i.pilcher@comcast.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Foreign key constraint & getErrorCode
Date: Sat, 11 Sep 2004 10:43:46 +1200
Message-ID: <41422E22.1010104@opencloud.com> (raw)
In-Reply-To: <chsidf$6ha$1@sea.gmane.org>
References: <chsidf$6ha$1@sea.gmane.org>

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



view thread (3+ messages)  latest in thread

Message-ID: <41422E22.1010104@opencloud.com>
Permalink:  ../41422E22.1010104@opencloud.com/
Also on:    postgresql.org/message-id/41422E22.1010104@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, i.pilcher@comcast.net
  Subject: Re: Foreign key constraint & getErrorCode
  In-Reply-To: <41422E22.1010104@opencloud.com>
  References: <chsidf$6ha$1@sea.gmane.org> <41422E22.1010104@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox