Re: Copy data from table to table - Mailing list pgsql-novice

From Frank Bax
Subject Re: Copy data from table to table
Date
Msg-id 5.2.1.1.0.20050427094718.035042c0@pop6.sympatico.ca
Whole thread Raw
In response to Copy data from table to table  ("Keith Worthington" <keithw@narrowpathinc.com>)
Responses Re: Copy data from table to table  (Keith Worthington <KeithW@NarrowPathInc.com>)
List pgsql-novice
At 09:16 AM 4/27/05, Keith Worthington wrote:

>Hi All,
>
>I can not think of a way to copy data directly betweeen two tables.
>
>I can only think of two ways to copy the data indirectly.
>
>Method 1:  Write a function that loops through the results of a select query
>running individual inserts for each record.
>
>Method 2:  Use SELECT INTO to put the desired data in a temporoary table; then
>use COPY to store the data in a file and finally use COPY to read the data
>from the file to the target table.


INSERT INTO ...  (SELECT FROM ...)

http://www.postgresql.org/docs/8.0/interactive/sql-insert.html

         What is the last word in synopsis?


pgsql-novice by date:

Previous
From: George Weaver
Date:
Subject: Re: Copy data from table to table
Next
From: "Van Ingen, Lane"
Date:
Subject: SQL COPY Command