Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtGGY-00043O-Du for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jan 2013 11:25:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TtGGX-00062Q-Cp for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jan 2013 11:25:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtGGW-00062K-I4 for pgsql-bugs@postgresql.org; Thu, 10 Jan 2013 11:25:44 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtGGT-0006vJ-L5 for pgsql-bugs@postgresql.org; Thu, 10 Jan 2013 11:25:44 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtGGR-00060y-6Y for pgsql-bugs@postgresql.org; Thu, 10 Jan 2013 11:25:40 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TtGGQ-0000m0-U8 for pgsql-bugs@postgresql.org; Thu, 10 Jan 2013 11:25:38 +0000 Date: Thu, 10 Jan 2013 11:25:38 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7802: Cannot drop table because of dependant sequence, but there is link to sequence To: pgsql-bugs@postgresql.org From: cwillemsen@technocon.com X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 7802 Logged by: Christiaan Willemsen Email address: cwillemsen@technocon.com PostgreSQL version: 9.1.7 Operating system: CentOS 6.2 Description:=20=20=20=20=20=20=20=20 I have a table that currently looks like this: CREATE TABLE old_table ( id bigint DEFAULT 0 ) Thats's it..=20 So, now when I drop the table is sais: ERROR: cannot drop table old_table because other objects depend on it DETAIL: default for table old_table column id depends on sequence old_table_id_seq HINT: Use DROP ... CASCADE to drop the dependent objects too. But clearly, that is not the case... This was however the case. This table was a partitioned table. I made a copy of the table to de-partition it, and reused the old sequence of the new table, then removed the sequence from the old table id. So for some reason Postgresql still thinks that the DEFAULT of this id is still connected to the sequence. I already tried changing the DEFAULT, truncate the table, drop all other columns, remove constraints and indexes, vacuum full, basically all I could think of. Still, it wont work. I don't want to drop the sequence in question, since it is in active use in the new table. I did exactly the same thing for another table that I de-partitioned, but there I had not problems. So how can I fix this? --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs