Re: invisible dependencies on a table? - Mailing list pgsql-general

From David Johnston
Subject Re: invisible dependencies on a table?
Date
Msg-id 1386909536815-5783254.post@n5.nabble.com
Whole thread Raw
In response to invisible dependencies on a table?  (Tim Uckun <timuckun@gmail.com>)
Responses Re: invisible dependencies on a table?  (Tim Uckun <timuckun@gmail.com>)
List 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.


pgsql-general by date:

Previous
From: Tim Uckun
Date:
Subject: invisible dependencies on a table?
Next
From: Dev Kumkar
Date:
Subject: Re: Case sensitivity