Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 06E509FB328 for ; Thu, 12 Oct 2006 02:12:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 47930-09 for ; Thu, 12 Oct 2006 02:12:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B294F9FA497 for ; Thu, 12 Oct 2006 02:12:01 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from outbound1.internet-mail-service.net (outbound1.internet-mail-service.net [216.240.47.192]) by svr4.postgresql.org (Postfix) with ESMTP id 1FA085AF2CB for ; Thu, 12 Oct 2006 05:12:01 +0000 (GMT) Received: from idiom.com (idiom.com [216.240.32.1]) by outbound.internet-mail-service.net (Postfix) with ESMTP id 2F92A33E322 for ; Wed, 11 Oct 2006 22:11:59 -0700 (PDT) Received: from [192.168.1.109] (adsl-71-135-172-180.dsl.pltn13.pacbell.net [71.135.172.180]) by idiom.com (8.12.11/8.12.11) with ESMTP id k9C5BwdM023096 for ; Wed, 11 Oct 2006 22:11:59 -0700 (PDT) (envelope-from bryce1@obviously.com) Message-ID: <452DCE97.2090706@obviously.com> Date: Wed, 11 Oct 2006 22:11:51 -0700 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060411 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Is this a bug? Deleting a column deletes the constraint. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/114 X-Sequence-Number: 26503 I got bit by this to be sure, but is it a bug? I guess I'd hoped for a warning at the critical step (see "poof" below): create table tester (one int, two int, three int); alter table only tester add constraint no_dupes unique (one, two, three); insert into tester values(1,2,3); insert into tester values(1,2,4); insert into tester values(1,2,3); -- this gets denied by the constraint alter table tester add column new_three varchar(8); alter table tester rename column three to old_three; \d tester; -- the constraint moves to the new column name alter table tester rename column new_three to three; \d tester; -- the constraint remains alter table tester drop column old_three; \d tester; -- poof, the constraint is gone with no warning -- ---- Visit http://www.obviously.com/