Re: Normalising an existing table - how?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Graham Leggett <minfrin(at)sharp(dot)fm>
Cc: Frank Bax <fbax(at)sympatico(dot)ca>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Normalising an existing table - how?
Date: 2004-06-25 08:37:55
Message-ID: 40DBE463.7060308@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Graham Leggett wrote:
> 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.

How can newtable contain data if you don't have any keys for it?

Perhaps a fuller example, with the schemas of the tables in question
would help.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2004-06-25 09:21:52 Re: feature request ?
Previous Message Richard Huxton 2004-06-25 08:33:30 Re: feature request ?