Is this a bug? Deleting a column deletes the constraint.

Поиск
Список
Период
Сортировка
От Bryce Nesbitt
Тема Is this a bug? Deleting a column deletes the constraint.
Дата
Msg-id 452DCE97.2090706@obviously.com
обсуждение исходный текст
Ответы Re: Is this a bug? Deleting a column deletes the constraint.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
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/



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Stuart McGraw"
Дата:
Сообщение: Re: slow view
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is this a bug? Deleting a column deletes the constraint.