Sunday, August 24, 2008

Re: [GENERAL] seq bug 2073 and time machine

Ivan Sergio Borgonovo wrote:
> I was trying to drop a serial.
> Dropped the default for a column.
> Now it seems I can't drop the sequence since I incurred in:
>
> http://archives.postgresql.org/pgsql-bugs/2005-11/msg00304.php
>
> Is there a way I can still delete the sequence without using a
> backup?

If you're feeling corageous, you can remove the pg_depend entries for
that sequence. Make sure to try it in a transaction and drop the
sequence in that same transaction, so that if you mess up the catalogs
too badly you can get out of it by rolling back.

In recent releases (I think 8.2 and beyond) you can use ALTER SEQUENCE
... OWNED BY to fix the problem without messing with the catalogs
directly. This is obviously recommended if available.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

No comments: