Re: seq bug 2073 and time machine - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: seq bug 2073 and time machine
Date
Msg-id 20080824212624.GB4506@alvh.no-ip.org
Whole thread Raw
In response to seq bug 2073 and time machine  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses playing with catalog tables limits? dangers? was: seq bug 2073 and time machine
List pgsql-general
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

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: psql \df+ [pattern] with overloaded functions
Next
From: Troy Rasiah
Date:
Subject: Re: Connection to second database on server