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 7EFF7D1B21B for ; Thu, 24 Jun 2004 18:45:21 -0300 (ADT) 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 21601-09 for ; Thu, 24 Jun 2004 21:45:22 +0000 (GMT) Received: from gatekeeper.fma.co.za (gatekeeper.fma.co.za [196.30.143.210]) by svr1.postgresql.org (Postfix) with ESMTP id A05EBD1B16E for ; Thu, 24 Jun 2004 18:45:18 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by gatekeeper.fma.co.za (Postfix) with ESMTP id 976FE33020; Thu, 24 Jun 2004 23:45:14 +0200 (SAST) Received: from gatekeeper.fma.co.za ([127.0.0.1]) by localhost (gatekeeper.fma.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26760-02; Thu, 24 Jun 2004 23:45:13 +0200 (SAST) Received: from [196.30.143.210] (gatekeeper.fma.co.za [196.30.143.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by gatekeeper.fma.co.za (Postfix) with ESMTP id 99A253301F; Thu, 24 Jun 2004 23:45:08 +0200 (SAST) Message-ID: <40DB4B64.5080101@sharp.fm> Date: Thu, 24 Jun 2004 23:45:08 +0200 From: Graham Leggett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040623 X-Accept-Language: en-za, en-us, en MIME-Version: 1.0 To: Frank Bax Cc: pgsql-sql@postgresql.org Subject: Re: Normalising an existing table - how? References: <5.2.1.1.0.20040624170431.04384a70@pop6.sympatico.ca> In-Reply-To: <5.2.1.1.0.20040624170431.04384a70@pop6.sympatico.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at fma.co.za X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/246 X-Sequence-Number: 18191 Frank Bax wrote: > Do all three steps in one command: > > create table newtable as (select key1, key2, money from oldtable); How would I put the primary key of each row in newtable back into oldtable? Also, newtable already exists and contains data - I need to add normalised data to an already partially normalised database. Regards, Graham --