Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 12254 invoked from network); 1 Jul 2010 22:05:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Jul 2010 22:05:27 -0000 Received: (qmail 90692 invoked by uid 500); 1 Jul 2010 22:05:27 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 90663 invoked by uid 500); 1 Jul 2010 22:05:26 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 90649 invoked by uid 99); 1 Jul 2010 22:05:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 22:05:26 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.6.24] (HELO gmp-eb-inf-2.sun.com) (192.18.6.24) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jul 2010 22:05:17 +0000 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged)) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o61M4pwn029461 for ; Thu, 1 Jul 2010 22:04:51 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0L4W00700FRMKJ00@fe-emea-10.sun.com> for derby-user@db.apache.org; Thu, 01 Jul 2010 23:04:28 +0100 (BST) Received: from [192.168.1.134] (c786A47C1.dhcp.bluecom.no [193.71.106.120]) by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <0L4W001NNFZF3JA0@fe-emea-10.sun.com> for derby-user@db.apache.org; Thu, 01 Jul 2010 23:04:28 +0100 (BST) Date: Fri, 02 Jul 2010 00:04:27 +0200 From: Knut Anders Hatlen Subject: Re: Dublicate key error on key values with hyphen In-reply-to: Sender: Knut.Hatlen@Sun.COM To: derby-user@db.apache.org Message-id: <4C2D10EB.5050605@sun.com> References: <4C2D079D.40102@sun.com> User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.9) Gecko/20100607 Thunderbird/3.0.4 X-Virus-Checked: Checked by ClamAV on apache.org On 07/ 1/10 11:46 PM, Max Stempfhuber wrote: > Hi Knut, > > thanks for the quick resonse! > > Yes, my database is set up with territory-based collation. I see your > point, but would the behaviour you describe be a feature or a bug in > regard to primary key values. Of cause I expected this for string > comparisons, but not for index values. > Is it worth filing a bug? My understanding is that this is a feature and that it works as designed. Primary key implies a unique constraint on the column. SQL's definition of uniqueness is based on the notion of equality, and if the two strings are considered equal (even though they are not identical), they are not unique. So I believe it is correct to reject the second insert if the collation rules ignore hyphens. -- Knut Anders