Re: INSERT...ON DUPLICATE KEY IGNORE - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: INSERT...ON DUPLICATE KEY IGNORE
Date
Msg-id CAM3SWZSYWprR_ezYS3cZi22bZNFf8Z=CVr_qLK40dt1++CwkKA@mail.gmail.com
Whole thread Raw
In response to Re: INSERT...ON DUPLICATE KEY IGNORE  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: INSERT...ON DUPLICATE KEY IGNORE
List pgsql-hackers
On Mon, Sep 2, 2013 at 6:25 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
> It'll be yet another way for people to get upsert wrong, of course.
> They'll use a wCTE with RETURNING REJECTS to do an UPDATE of the rejects
> w/o locking the table against writes first. Documenting this pitfall
> should be enough, though.

My preferred solution is to actually provide a variant to lock the
rows implicated in the would-be unique constraint violation. Obviously
that's a harder problem to solve.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: [GENERAL] currval and DISCARD ALL
Next
From: Jeff Davis
Date:
Subject: Re: ENABLE/DISABLE CONSTRAINT NAME