| From: | "fdu(dot)xiaojf(at)gmail(dot)com" <fdu(dot)xiaojf(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: How to insert on duplicate key? |
| Date: | 2007-12-25 03:25:55 |
| Message-ID: | 47707843.7090402@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Michael Glaesemann wrote:
>
> On Dec 24, 2007, at 22:03 , fdu(dot)xiaojf(at)gmail(dot)com wrote:
>
>> I have googled and currently the only way I can find is do query first
>> and then update or insert.
>
> Or alternatively, UPDATE and see if you've affected any rows. If not,
> insert.
>
> Michael Glaesemann
> grzm seespotcode net
>
>
>
Thanks for your quick reply!
Is the update and insert method quick?
I have tried the query and update/insert way, and it was very slow when more
than 1 million records have been inserted. (I have more than 20 million
records to insert.)
Thanks again!
Xiao Jianfeng
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Greg Smith | 2007-12-25 07:15:15 | Re: How to insert on duplicate key? |
| Previous Message | Michael Glaesemann | 2007-12-25 03:20:26 | Re: How to insert on duplicate key? |