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

Re: Copy data from table to table

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Keith Worthington <keithw(at)narrowpathinc(dot)com>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Copy data from table to table
Date: 2005-04-27 13:34:44
Message-ID: 20050427133444.GA34371@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-novice
On Wed, Apr 27, 2005 at 09:16:09AM -0400, Keith Worthington wrote:
> 
> I can not think of a way to copy data directly betweeen two tables.

Have you tried INSERT ... SELECT?

INSERT INTO foo (a, b, c) SELECT a, b, c FROM bar;

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

pgsql-novice by date

Next:From: George WeaverDate: 2005-04-27 13:36:00
Subject: Re: Copy data from table to table
Previous:From: Keith WorthingtonDate: 2005-04-27 13:16:09
Subject: Copy data from table to table

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