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/ ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq