Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group