Re: Copying data from one table to another - Mailing list pgsql-general

From Richard Huxton
Subject Re: Copying data from one table to another
Date
Msg-id 200402281640.26882.dev@archonet.com
Whole thread Raw
In response to Copying data from one table to another  (Erwin Van de Velde <erwin.vandevelde@ua.ac.be>)
List pgsql-general
On Saturday 28 February 2004 16:08, Erwin Van de Velde wrote:
>
> I have to copy data from one table to another, and I was wondering if there
> is an easier way to do that than to have a lot of inserts one after
> another.

> Is there a trick to let the INSERT
> command take more than one tuple at once?

Think in sets. As long as you can define the conditions for copying rows:

INSERT INTO table2 SELECT * FROM table1 WHERE somefield='some value';

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Erwin Van de Velde
Date:
Subject: Copying data from one table to another
Next
From: "Karl O. Pinc"
Date:
Subject: Triggers per transaction, workaround? prospects?