Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 95926 invoked from network); 25 Feb 2008 19:47:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Feb 2008 19:47:50 -0000 Received: (qmail 45032 invoked by uid 500); 25 Feb 2008 19:47:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 44998 invoked by uid 500); 25 Feb 2008 19:47:45 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 44989 invoked by uid 99); 25 Feb 2008 19:47:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2008 11:47:45 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.19.6] (HELO sineb-mail-1.sun.com) (192.18.19.6) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2008 19:47:09 +0000 Received: from fe-apac-02.sun.com (fe-apac-02.sun.com [192.18.19.173] (may be forged)) by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id m1PJlHuh010198 for ; Mon, 25 Feb 2008 19:47:22 GMT Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JWT002016JDU800@mail-apac.sun.com> (original mail from Anurag.Shekhar@Sun.COM) for derby-dev@db.apache.org; Tue, 26 Feb 2008 03:47:12 +0800 (SGT) Received: from [192.168.1.110] ([122.171.0.10]) by mail-apac.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JWT00IKJ8AJP7F1@mail-apac.sun.com> for derby-dev@db.apache.org; Tue, 26 Feb 2008 03:47:12 +0800 (SGT) Date: Tue, 26 Feb 2008 01:17:06 +0530 From: Anurag shekhar Subject: Re: [jira] Updated: (DERBY-3330) provide support for unique constraint over nullable columns In-reply-to: <47BF2429.5060407@gmail.com> Sender: Anurag.Shekhar@Sun.COM To: derby-dev@db.apache.org Message-id: <47C31B3A.6080209@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=UTF-8 Content-transfer-encoding: 7BIT References: <953582638.1203700159726.JavaMail.jira@brutus> <47BF10A7.50008@sbcglobal.net> <47BF13A8.6090908@sun.com> <47BF1DFC.6050407@sbcglobal.net> <47BF2429.5060407@gmail.com> User-Agent: Thunderbird 1.5.0.14pre (X11/20071023) X-Virus-Checked: Checked by ClamAV on apache.org Army wrote: > > I haven't been following this discussion at all, but for what it's > worth, this same sort of question came up in the context of > DERBY-3299. I went with the simple approach of dropping the old index > and creating the new one, so some logic for that kind of thing is now > in the 10.4 codeline. I plan to build on that a bit more for > DERBY-2204, though the latter changes probably won't be in for 10.4. > > The changes for DERBY-3299 are entirely language-layer, but perhaps > it's something that can be used here? Again, I don't really know > since I haven't been on top of this issue, but I thought I'd mention > it... > Looks like I will have to recreate index while setting the column to nullable. The backing index, when the column was not null, will be a unique index but the new index is going to be unique when not null type. So it won't be proper to replace existing references of the current index by the new one. I will intead drop the index with recreate set as true (so a new index will be automatically created if its required) and create a new index for exclusive use of unique constraint. anurag