Re: drop table cascade doesn't drop manual sequences - Mailing list pgsql-general

From Tom Lane
Subject Re: drop table cascade doesn't drop manual sequences
Date
Msg-id 3360.1192390770@sss.pgh.pa.us
Whole thread Raw
In response to Re: drop table cascade doesn't drop manual sequences  (Andreas Kretschmer <akretschmer@spamfence.net>)
List pgsql-general
Andreas Kretschmer <akretschmer@spamfence.net> writes:
> Tom Lane <tgl@sss.pgh.pa.us> schrieb:
>> 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 :-(

> Really no way to recognize with pg_* or information_schema.* ? I can't
> believe this, but i don't know a way...

Well, ALTER OWNED BY works by adding or removing a pg_depend entry, and
if you wanted to get down and dirty you could do that manually in
earlier releases.  I wouldn't recommend it though ...

            regards, tom lane

pgsql-general by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: drop table cascade doesn't drop manual sequences
Next
From: Geoffrey
Date:
Subject: Re: reporting tools