Re: Use of Serial Datatype and Sequence Issue

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: Use of Serial Datatype and Sequence Issue
Дата
Msg-id m3hes9rthm.fsf@belphigor.mcnaught.org
обсуждение исходный текст
Ответ на Use of Serial Datatype and Sequence Issue  (Tom Innes <tinnes@inforamp.net>)
Список pgsql-general
Tom Innes <tinnes@inforamp.net> writes:

> I am new to postgres and am in the process of creating a new database of
> several 100 tables.  Most of the tables have a serial datatype. When the
> table is created psql says it is creating an implicit sequence.  Yet
> when I drop the table and even when I drop the database the sequence is
> still there. When I try to re-create the table it fails beacuse the
> sequence already exists.  This same behaviour exists for indexes.  How
> can I get rid of any sequences or indexes that have been created.  I
> would prefer not to explicitly drop each one.  Ideally I would like to
> drop the table and have all related indexes, sequences dropped.

Hmmm, I see part of this bug in 7.1.2 as well.  The index goes away
when the table is dropped, but the sequence remains and causes an
error when I try to recreate the table.  But dropping the database
(with DROP DATABASE or with 'destroydb' from the shell) blows away
everything, including the sequence, as it should.

Haven't got 7.1.3 to try it on--what version are you using?

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: request for advise
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Define update-rule on view