X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B4E26329E58 for ; Fri, 10 Sep 2004 23:43:58 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41504-04 for ; Fri, 10 Sep 2004 22:43:50 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id C37CE329C65 for ; Fri, 10 Sep 2004 23:43:50 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1C5u7P-0005P4-00; Sat, 11 Sep 2004 10:43:47 +1200 Message-ID: <41422E22.1010104@opencloud.com> Date: Sat, 11 Sep 2004 10:43:46 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ian Pilcher Cc: pgsql-jdbc@postgresql.org Subject: Re: Foreign key constraint & getErrorCode References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/31 X-Sequence-Number: 10921 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