Re: dropping sequences

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: dropping sequences
Дата
Msg-id 15125.1056769558@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: dropping sequences  (Erik Price <eprice@ptc.com>)
Список pgsql-general
Erik Price <eprice@ptc.com> writes:
> But when I try to drop the sequence altogether:

> be_db=# DROP SEQUENCE news_news_id_seq;
> ERROR:  Cannot drop sequence news_news_id_seq because table news column
> news_id requires it

That's intentional: the sequence is part of the implementation of a
serial column, and you should not be able to remove it separately.
(You really shouldn't be able to dork with the column's DEFAULT
expression either, but we don't currently have a way to enforce that.)

> Anybody have a suggestion?  I just want to remove these sequences from
> the database altogether.  Am I going to have to drop the news_id column
> altogether?

If you are really intent on deconstructing the sequence mechanism for
this column, you could find and delete the pg_depend row that represents
the dependency.  Details are left as an exercise for the student ...

            regards, tom lane

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: [BUGS] Problem with duplicate file.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PlPython