Re: Normalising an existing table - how? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Normalising an existing table - how?
Date
Msg-id 40DBE463.7060308@archonet.com
Whole thread Raw
In response to Re: Normalising an existing table - how?  (Graham Leggett <minfrin@sharp.fm>)
Responses Re: Normalising an existing table - how?
List 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


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: feature request ?
Next
From: sad
Date:
Subject: Re: feature request ?