Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>, Peter Geoghegan <pg(at)heroku(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Date: 2014-09-29 03:53:32
Message-ID: 5428D7BC.6020305@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/29/2014 06:41 AM, Gavin Flower wrote:
>
> I can suspect that people are much more likely to look for 'MERGE' in an
> index, or look for 'MERGE' in the list of SQL commands, than 'UPSERT'.

and/or to be looking for MySQL's:

ON DUPLICATE KEY {IGNORE|UPDATE}

What astonishes me when I look around at how other RDBMS users solve
this is how many of them completely ignore concurrency issues. e.g. in
this SO question:

http://stackoverflow.com/q/108403/398670

there's an alarming lack of concern for concurrency, just a couple of
links to :

http://www.mssqltips.com/sqlservertip/3074/use-caution-with-sql-servers-merge-statement/

(BTW, that article contains some useful information about corner cases
any upsert approach should test and deal with).

Similar with Oracle: Alarming lack of concern for concurrency among users:

http://stackoverflow.com/q/237327/398670

Useful article:

http://michaeljswart.com/2011/09/mythbusting-concurrent-updateinsert-solutions/

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-09-29 04:03:21 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Previous Message Платон Малюгин 2014-09-29 03:42:29 Add generate_series(numeric, numeric)