BUG #7802: Cannot drop table because of dependant sequence, but there is link to sequence

Поиск
Список
Период
Сортировка
От cwillemsen@technocon.com
Тема BUG #7802: Cannot drop table because of dependant sequence, but there is link to sequence
Дата
Msg-id E1TtGGQ-0000m0-U8@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #7802: Cannot drop table because of dependant sequence, but there is link to sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      7802
Logged by:          Christiaan Willemsen
Email address:      cwillemsen@technocon.com
PostgreSQL version: 9.1.7
Operating system:   CentOS 6.2
Description:        =


I have a table that currently looks like this:

CREATE TABLE old_table
(
  id bigint DEFAULT 0
)

Thats's it.. =


So, now when I drop the table is sais:

ERROR:  cannot drop table old_table because other objects depend on it
DETAIL:  default for table old_table column id depends on sequence
old_table_id_seq
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

But clearly, that is not the case... This was however the case. This table
was a partitioned table. I made a copy of the table to de-partition it, and
reused the old sequence of the new table, then removed the sequence from the
old table id. So for some reason Postgresql still thinks that the DEFAULT of
this id is still connected to the sequence. I already tried changing the
DEFAULT, truncate the table, drop all other columns, remove constraints and
indexes, vacuum full, basically all I could think of. Still, it wont work.

I don't want to drop the sequence in question, since it is in active use in
the new table.

I did exactly the same thing for another table that I de-partitioned, but
there I had not problems.

So how can I fix this?

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

Предыдущее
От: Rodrigo Rosenfeld Rosas
Дата:
Сообщение: Re: wrong search_path being used
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #7802: Cannot drop table because of dependant sequence, but there is link to sequence