Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 32ABB9F95CD for ; Sun, 11 Nov 2007 11:37:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 11780-09 for ; Sun, 11 Nov 2007 11:37:07 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D47DA9F9600 for ; Sun, 11 Nov 2007 11:37:12 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lABFbBLZ018970; Sun, 11 Nov 2007 10:37:11 -0500 (EST) To: "Erik Aronesty" cc: pgsql-admin@postgresql.org Subject: Re: alter table serial->int In-reply-to: References: <7625.1194412270@sss.pgh.pa.us> <20071108195721.GU2938@alvh.no-ip.org> Comments: In-reply-to "Erik Aronesty" message dated "Sun, 11 Nov 2007 07:15:01 -0500" Date: Sun, 11 Nov 2007 10:37:11 -0500 Message-ID: <18969.1194795431@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/92 X-Sequence-Number: 27335 "Erik Aronesty" writes: > alter table x alter a set default 999; > still doesn't help. Doesn't help what? If you mean that the sequence object is still there, you can drop that too. regression=# create table x(a serial not null); NOTICE: CREATE TABLE will create implicit sequence "x_a_seq" for serial column "x.a" CREATE TABLE regression=# drop sequence x_a_seq; NOTICE: default for table x column a depends on sequence x_a_seq ERROR: cannot drop sequence x_a_seq because other objects depend on it HINT: Use DROP ... CASCADE to drop the dependent objects too. regression=# alter table x alter a set default 999; ALTER TABLE regression=# drop sequence x_a_seq; DROP SEQUENCE regression=# \d x Table "public.x" Column | Type | Modifiers --------+---------+---------------------- a | integer | not null default 999 regards, tom lane