batch insert/update

From: "blackwater dev" <blackwaterdev(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: batch insert/update
Date: 2007-12-26 18:57:18
Message-ID: 34a9824e0712261057v79de9c14ncc032fa43417252d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have some php code that will be pulling in a file via ftp. This file will
contain 20,000+ records that I then need to pump into the postgres db.
These records will represent a subset of the records in a certain table. I
basically need an efficient way to pump these rows into the table, replacing
matching rows (based on id) already there and inserting ones that aren't.
Sort of looping through the result and inserting or updating based on the
presents of the row, what is the best way to handle this? This is something
that will run nightly.

Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2007-12-26 19:25:34 Re: how to alter an enum type
Previous Message Henrique Pantarotto 2007-12-26 18:17:15 Re: how to alter an enum type