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 C3E72563E3 for ; Mon, 14 Mar 2005 09:02:18 +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 35179-07 for ; Mon, 14 Mar 2005 09:02:09 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id 6C6CE563CD for ; Mon, 14 Mar 2005 09:02:08 +0000 (GMT) Received: (qmail 23603 invoked from network); 14 Mar 2005 10:02:13 +0100 Received: from unknown (HELO localhost) (boutiquenumerique-lists@192.168.0.4) by boutiquenumerique.com with SMTP; 14 Mar 2005 10:02:13 +0100 Date: Mon, 14 Mar 2005 10:02:08 +0100 To: bernard@bgsoftfactory.com, pgsql-sql@postgresql.org Subject: Re: Newbie wonder... References: <1mmif8pua8zxb.q7qw4hme6jk5.dlg@40tude.net> From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <1mmif8pua8zxb.q7qw4hme6jk5.dlg@40tude.net> User-Agent: Opera M2/7.54 (Linux, build 955) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/192 X-Sequence-Number: 20671 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 ! However, you might also like to de-dupe your data once it's in the additional tables, thus you might need more complicated measures. > (2) How should I go to create a sequence for an existing table? For all > futures data entry, after this conversion, I want the unique ID for each > row to come from a sequence, but if I know how to create a table using > serial, I am not sure how to modify one for this. > > Thanks, > Bernard > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >