Re: drop table cascade doesn't drop manual sequences

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: Guilherme <antoniolo(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: drop table cascade doesn't drop manual sequences
Date: 2007-10-14 16:14:40
Message-ID: 28684.1192378480@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> writes:
> On 10/10/07, Guilherme <antoniolo(at)gmail(dot)com> wrote:
>> If I insert a sequence later on table creation with alter table, drop
>> table cascade simply doesn't drop this sequence even when I specify
>> CASCADE.

> This is normal.

In 8.2 and up you can use ALTER SEQUENCE ... OWNED BY ... to establish a
link that will make a manually created sequence go away when its "owner"
column is dropped. In 8.1 that aspect of SERIAL is hidden magic :-(

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message novnov 2007-10-14 16:15:28 What encoding to use for English, French, Spanish
Previous Message Tom Lane 2007-10-14 15:58:48 Re: Aggregate View and Conditions taking FOREVER