invisible dependencies on a table?

Поиск
Список
Период
Сортировка
От Tim Uckun
Тема invisible dependencies on a table?
Дата
Msg-id CAGuHJrPC4UCXRmsUUhnS0ykCdCPspv9TkKjg=OMCznyUuALZFQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: invisible dependencies on a table?
Re: invisible dependencies on a table?
Список pgsql-general
I have a table foo. It has a serial column called "id".  I execute the following statement

ALTER TABLE table_name RENAME TO  archived_table_name;
          CREATE TABLE table_name (LIKE archived_table_name INCLUDING DEFAULTS       INCLUDING CONSTRAINTS INCLUDING INDEXES);

..... Archieve the table here...

DROP TABLE arhived_table_name

This doesn't work because the archived table name has a dependency on the sequence created by the serial field.  So I try to remove that dependency by doing this.

alter table "archived_table_name" alter column id drop default;
 ALTER TABLE"archived_table_name"  DROP CONSTRAINT systemevents_pkey;

So by now there should not be a dependency on the sequence but I still can't drop the table and and pgadmin tells me it's still depending on the sequence.

When I look at the table definition it doesn't seem to have any reference to the sequence at all.

How can I drop this table and leave the sequence alone? Obviously the newly created table needs it.

Thanks.

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

Предыдущее
От: John Melesky
Дата:
Сообщение: Re: Zero dead tuples, when significant apparent bloat
Следующее
От: David Johnston
Дата:
Сообщение: Re: invisible dependencies on a table?