Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YqAaw-0003aH-R0 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 May 2015 01:27:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YqAav-0004KP-Qn for pgsql-hackers@arkaria.postgresql.org; Thu, 07 May 2015 01:27:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YqAau-0004KI-N8 for pgsql-hackers@postgresql.org; Thu, 07 May 2015 01:27:20 +0000 Received: from smtp2.scorpionshops.com ([82.118.24.228] helo=kilimanjaro.scorpionshops.com) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YqAas-0007EG-Dn for pgsql-hackers@postgresql.org; Thu, 07 May 2015 01:27:19 +0000 Received: from [192.168.1.4] (92-32-205-89.tn.glocalnet.net [92.32.205.89]) by kilimanjaro.scorpionshops.com (Postfix) with ESMTPSA id DF8ED7BC0A2; Thu, 7 May 2015 03:27:16 +0200 (CEST) Message-ID: <554ABF43.40708@proxel.se> Date: Thu, 07 May 2015 03:26:27 +0200 From: Andreas Karlsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: hlinnaka@iki.fi, Peter Geoghegan , Andres Freund CC: Jeff Janes , Stephen Frost , Dean Rasheed , Bruce Momjian , Pg Hackers Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 References: <20150505154030.GI9855@alap3.anarazel.de> <20150506152007.GN9855@alap3.anarazel.de> <554A70CF.8090608@iki.fi> In-Reply-To: <554A70CF.8090608@iki.fi> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.4 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 05/06/2015 09:51 PM, Heikki Linnakangas wrote: >> So, yes, DO NOTHING does very little - and that is its appeal. >> Supporting this behavior does not short change those who actually care >> about the existing tuple sticking around for the duration of their >> transaction - they have a way of doing that. If you want to document >> INSERT IGNORE as being primarily an ETL-orientated thing, that would >> make sense, but let's not hobble that use case. > > Yeah, I agree that DO NOTHING should not lock the rows. It might make > sense to have a DO LOCK variant, which locks the rows, although I don't > immediately see what the use case would be. It seems like a very useful feature to me, if you want to upsert something into a table with a serial column and get the value of the serial column in a RETURNING clause (but not update any fields if there is a conflict). Then I am pretty sure I want to lock the row. Andreas -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers