appending from table to table

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: appending from table to table
Date: 2002-03-01 15:52:33
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB0452E026@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howdy :

I'm running Postgres 7.1.3 on RedHat Linux 7.2 kernel version 2.4.7 rel 10.

(I'm on a roll today with the questions, right?)

Say I have a table. On a monthly basis, someone exports from MS Access a
new table
but the contents needs to be appended into the pre-existing table (call it
orig_table).

I'm trying to develop an automated means to do this, but the best I could
come up with is:

* run a cron job to dump the new table into a flat file
*modify the flat file - insert a line that says '\copy orig_table from
<name_of_file>'
* run a job that wakes up and `psql -U <user> -d <database> -f
./<name_of_file> `
*verify the orig_table (maybe get a count of new records; before / after;
something).

Is there an easier way to do this?

Thanks!

-X

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2002-03-01 16:04:10 Re: check sql progress
Previous Message Tom Lane 2002-03-01 15:49:46 Re: check sql progress