Excerpts from Todd Kover's message of mar ago 07 20:10:25 -0400 2012:
> Given this:
> ---<snip>---
> drop table IF EXISTS foo;
> drop table IF EXISTS foo_v26;
>=20
> create table foo (id serial not null, bar integer );
> alter table foo alter column id drop default;
>=20
> alter table foo rename to foo_v26;
>=20
> create table foo (id integer not null, bar integer );
>=20
> alter table foo alter id SET DEFAULT nextval('foo_id_seq');
>=20
> drop table foo_v26;
> ---<snip>---
>=20
> everthing works as expected until the final drop, which says:
>=20
> jazzhands=3D> drop table foo_v26;
> ERROR: cannot drop table foo_v26 because other objects depend on it
> DETAIL: default for table foo column id depends on sequence foo_id_seq
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
I think you need an ALTER SEQUENCE .. OWNED BY to fix up dependencies
for the sequence.
--=20
=C3=81lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services