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

copying data between tables

From: Tsirkin Evgeny <tsurkin(at)mail(dot)jct(dot)ac(dot)il>
To: pgsql-admin(at)postgresql(dot)org
Subject: copying data between tables
Date: 2004-02-27 02:40:12
Message-ID: opr30cdaj0jbdarf@localhost (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Hi all!
I have the following task :
I have some tables edited (insert/update) by users.
I should create a file (in whatever format) containing
changes of the last day,every day.What I have currently
is :
I have two tables of the same structer ,every day i :

select * from newtable
select * from oldtable

And then format the data with perl script.After that ,i
am copying the data from the new table to the old table .It
works pretty good except that the copying is VERY slow:
I use :
insert into old from (select * from newtable);

Is there any more afficient way to do what i need ,
that somebody already use?
Is there any more afficient way to copy data between
I know that i can use COPY to copy files from
and to files ,can it be used here?


pgsql-admin by date

Next:From: John AllgoodDate: 2004-02-27 03:20:54
Subject: Running Multiple Postmasters
Previous:From: Tom LaneDate: 2004-02-26 22:34:09
Subject: Re: un-CLUSTER?

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