From: Jean-Michel Chabanne <jeanmichel.chabanne@online.fr>
To: Tsirkin Evgeny <tsurkin@mail.jct.ac.il>
Cc: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: copying data between tables
Date: Fri, 27 Feb 2004 20:14:53 +0100
Message-ID: <1077909293.1345.3.camel@yoyo.local> (raw)
In-Reply-To: <opr30cdaj0jbdarf@localhost>
References: <opr30cdaj0jbdarf@localhost>
Le ven 27/02/2004 à 03:40, Tsirkin Evgeny a écrit :
> 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
> except
> 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
> tables?
> I know that i can use COPY to copy files from
> and to files ,can it be used here?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>
If I had to do this, I would use triggers which, on every INSERT/UPDATE
by users, would insert the new item + timestamp or date in a new table.
I hope this will help you.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: jeanmichel.chabanne@online.fr, tsurkin@mail.jct.ac.il
Subject: Re: copying data between tables
In-Reply-To: <1077909293.1345.3.camel@yoyo.local>
References: <opr30cdaj0jbdarf@localhost> <1077909293.1345.3.camel@yoyo.local>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox