BUG #2336: will not drop implicitly created sequence

Поиск
Список
Период
Сортировка
От Chris Mair
Тема BUG #2336: will not drop implicitly created sequence
Дата
Msg-id 200603192043.k2JKho1n047098@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #2336: will not drop implicitly created sequence  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      2336
Logged by:          Chris Mair
Email address:      chris@1006.org
PostgreSQL version: 8.1.3
Operating system:   MacOS X 10.3.9
Description:        will not drop implicitly created sequence
Details:

Ok, so this is probably not a bug at all - just slightly unexpected
behaviour.

This piece of SQL:
---------------------------------------------------
create table test2 (id serial, txt varchar);
    -- (will create implicit sequence "test2_id_seq")
alter table test2 alter id set default 123;
drop sequence test2_id_seq;
---------------------------------------------------

would say:
---------------------------------------------------
ERROR:  2BP01: cannot drop sequence test2_id_seq because table test2 column
id requires it
HINT:  You may drop table test2 column id instead.
LOCATION:  recursiveDeletion, dependency.c:472
---------------------------------------------------

as if test2.id would still use the sequence.

Contrast this with the same thing done with an explicitly declared
sequence:
---------------------------------------------------
create sequence test1_id_seq;
create table test1 (id int not null default nextval('test1_id_seq'), txt
varchar);
alter table test1 alter id set default 123;
drop sequence test1_id_seq;
---------------------------------------------------

which will just work fine.

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

Предыдущее
От: Tom Hollins
Дата:
Сообщение: Re: BUG #2327: Startup script for FC4 with selinux
Следующее
От: Dhanaraj M - Sun Microsystems
Дата:
Сообщение: how to put back?