Re: How to insert on duplicate key?

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: "fdu(dot)xiaojf(at)gmail(dot)com" <fdu(dot)xiaojf(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to insert on duplicate key?
Date: 2007-12-25 03:20:26
Message-ID: 41276A54-80FC-4864-8A5F-77AF2554D6AB@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message fdu.xiaojf@gmail.com 2007-12-25 03:25:55 Re: How to insert on duplicate key?
Previous Message fdu.xiaojf@gmail.com 2007-12-25 03:03:25 [TLM] How to insert on duplicate key?