Re: Migrating Data Between PG Tables - Mailing list pgsql-admin

From banghe
Subject Re: Migrating Data Between PG Tables
Date
Msg-id 41630263.1080301@baileylink.net
Whole thread Raw
In response to Migrating Data Between PG Tables  (Mike Darretta <michael.darretta.ctr@metnet.navy.mil>)
Responses Re: Migrating Data Between PG Tables  (Mike Darretta <michael.darretta.ctr@metnet.navy.mil>)
List pgsql-admin
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
>


pgsql-admin by date:

Previous
From: Mike Darretta
Date:
Subject: Migrating Data Between PG Tables
Next
From: Mike Darretta
Date:
Subject: Re: Migrating Data Between PG Tables