Re: invisible dependencies on a table?

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: invisible dependencies on a table?
Date: 2013-12-13 04:38:56
Message-ID: 1386909536815-5783254.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tim Uckun wrote
> How can I drop this table and leave the sequence alone? Obviously the
> newly
> created table needs it.

<not tested>

You cannot. You need to put the sequence up for adoption and have the "new"
table become its parent/owner.

http://www.postgresql.org/docs/9.2/interactive/sql-altersequence.html

ALTER SEQUENCE ... OWNED BY ... ;

I cannot readily speak to why you are not seeing sequence ownership as a
dependent when looking at the now-archive table definition.

Dropping the "systemevents_pkey" solved nothing (the PK constraint is part
of the table definition and furthermore has nothing to do with the sequence)
and really you wouldn't have to "drop default" either since all you are
doing is removing a dependency that the sequence has on the table: i.e., you
cannot drop the sequence until you drop the default - not the other way
around.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/invisible-dependencies-on-a-table-tp5783252p5783254.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dev Kumkar 2013-12-13 07:08:42 Re: [GENERAL] Case sensitivity
Previous Message Tim Uckun 2013-12-13 04:24:54 invisible dependencies on a table?