X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3836C563B4 for ; Mon, 14 Mar 2005 13:57:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23661-07 for ; Mon, 14 Mar 2005 13:57:11 +0000 (GMT) Received: from tht.net (vista.tht.net [216.126.88.2]) by svr1.postgresql.org (Postfix) with ESMTP id B44525638A for ; Mon, 14 Mar 2005 13:57:10 +0000 (GMT) Received: from dyn-70-66.tor.dsl.tht.net (dyn-70-66.tor.dsl.tht.net [134.22.70.66]) by tht.net (Postfix) with ESMTP id 97A3B76A48; Mon, 14 Mar 2005 08:57:15 -0500 (EST) Subject: Re: Newbie wonder... From: Rod Taylor To: PFC Cc: pgsql-sql@postgresql.org, bernard@bgsoftfactory.com In-Reply-To: References: <1mmif8pua8zxb.q7qw4hme6jk5.dlg@40tude.net> Content-Type: text/plain Date: Mon, 14 Mar 2005 08:56:22 -0500 Message-Id: <1110808582.1132.34.camel@home> Mime-Version: 1.0 X-Mailer: Evolution 2.2.0 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.015 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/199 X-Sequence-Number: 20678 On Mon, 2005-03-14 at 10:02 +0100, PFC wrote: > If you want to add a SERIAL field to an existing table, create a sequence > and then create an integer field with default nextval(seq) and postgres > will fill it automatically. The order in which it will fill it is not > guaranteed though ! With 8.0, Alter Table supports most complicated commands including the addition of SERIAL directly. alter table abc add column bob serial NOT NULL UNIQUE; --