From: Mike Darretta <michael.darretta.ctr@metnet.navy.mil>
To: banghe <banghe@baileylink.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Migrating Data Between PG Tables
Date: Tue, 05 Oct 2004 13:29:35 -0700
Message-ID: <4163042F.3060805@metnet.navy.mil> (raw)
In-Reply-To: <41630263.1080301@baileylink.net>
References: <200410050159.i951xOH02113@candle.pha.pa.us>
<41630082.4090802@metnet.navy.mil>
<41630263.1080301@baileylink.net>
banghe wrote:
> One sql statement can solve this:
>
> sql> isnert into table_b (id, name, summary) select id, name, desc
> from table_a;
>
> Banghe
>
> Mike Darretta wrote:
>
>> Does anyone have a suggestion on the best way to migrate data between
>> two slightly different tables? For example:
>>
>> Table A
>> --------
>> id : integer
>> name : string
>> desc : string
>>
>>
>> Table B
>> --------
>> id : integer
>> name : string
>> date : date
>> summary : string
>>
>> In this example, I would like to copy all the data from Table A into
>> B, using the desc column to populate the summary column.
>>
>> Thanks,
>> Mike
>>
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>>
>
>
Thanks. I figured it was simple...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: michael.darretta.ctr@metnet.navy.mil, banghe@baileylink.net
Subject: Re: Migrating Data Between PG Tables
In-Reply-To: <4163042F.3060805@metnet.navy.mil>
References: <200410050159.i951xOH02113@candle.pha.pa.us> <41630082.4090802@metnet.navy.mil> <41630263.1080301@baileylink.net> <4163042F.3060805@metnet.navy.mil>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox