Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 0A6449F9250 for ; Thu, 8 Nov 2007 15:57:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 97630-03-3 for ; Thu, 8 Nov 2007 15:57:27 -0400 (AST) Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 02F2F9F9277 for ; Thu, 8 Nov 2007 15:57:24 -0400 (AST) Received: from alvh.no-ip.org (200-85-205-122.bk3-dsl.surnet.cl [200.85.205.122]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.7) with ESMTP id lA8JvPhf021585; Thu, 8 Nov 2007 11:57:26 -0800 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 46786560230; Thu, 8 Nov 2007 16:57:21 -0300 (CLST) Date: Thu, 8 Nov 2007 16:57:21 -0300 From: Alvaro Herrera To: Erik Aronesty Cc: pgsql-admin@postgresql.org Subject: Re: alter table serial->int Message-ID: <20071108195721.GU2938@alvh.no-ip.org> Mail-Followup-To: Erik Aronesty , pgsql-admin@postgresql.org References: <7625.1194412270@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 08 Nov 2007 11:57:26 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/69 X-Sequence-Number: 27312 Erik Aronesty wrote: > -- Simpler example for you > > CREATE TABLE x ( > id serial NOT NULL > ); > > ALTER TABLE x alter id type int; > > -- Under 8.1.10, a call to pg_dump will reveal the change has not happened Do an ALTER TABLE DROP DEFAULT instead. SERIAL is a macro for "int with a default". -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.