Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA5iJ-0001pB-VZ for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Nov 2017 02:58:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eA5iJ-0001WT-IV for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Nov 2017 02:58:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eA5iI-0001TD-Mj for pgsql-hackers@postgresql.org; Thu, 02 Nov 2017 02:58:38 +0000 Received: from mail-vk0-x22c.google.com ([2607:f8b0:400c:c05::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eA5iF-0002zu-O1 for pgsql-hackers@postgresql.org; Thu, 02 Nov 2017 02:58:37 +0000 Received: by mail-vk0-x22c.google.com with SMTP id g69so2699214vke.5 for ; Wed, 01 Nov 2017 19:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UF4Gd0ZeI+2CfqiizyeoI8Dx4koA8PWkk8rNHy1FZck=; b=PaTCS8PfllUeAFl/dvzcaJc6C32hEIE+7NpO1OzHLVaVRzCajKFgkh2xBE0vtZlq+P LmQrJ9r4yI+Oa6CQhxOqPMJXdmRYBHk6tEinczlImxCYnLbSrhAa0f8cP7O0OB/ht47L iq+OthP4Gsb4EXiWKdQ68LO/Z9hM1p9iQGlMsQZaAgHsGvlGo8VoixtsF+B9PoaLov/S sBh4Z4HnNzRdEBg5WvuSlqYeJnqUlUbA99s3I1LsjdFUQ1DEzVLLVQ0uHM+/kzMvgQs0 wefnkNcwA/Kdza25ciCQSKSf5iy4RYve9782j5AwfZxI9tqalT99zNdT6BIM7BYT3J28 MbiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UF4Gd0ZeI+2CfqiizyeoI8Dx4koA8PWkk8rNHy1FZck=; b=NmAZQwK2gqY7jk2ppCdF90rlRZ6sDcWEgimjC19ePUnT7QC51dvnm1NgkAdOyrDusZ c3kj1m0W9AMUNZahE/K8V2t+8Q7wus3XZvqFhxHrlAwC3Yht0ICuCg4BXXFws/NpxbSS Gynh//jT3GcE7EMF6LeogQBQdUKOSuIDy9vINlTrc1MVaBoPnTROQQoDDUfHFXRP58iL l6zB2E8V7XRuXAE3SrmFbH/4j4Ci/5hU9UZd0E4l7vVpW7XjxbXuV0js6aAJ1Qsgms3C OQyp8fsndLOpZgk23JG7FpPYmQS/fGH57V/PDI7VFcLbmRcUNSLJlvL94l+hKfO5bdpB HbeA== X-Gm-Message-State: AMCzsaUv/Zb2Hm6ZRUET5sVaGwf8WVL4L1JH7VcG5E2FSb1I5xgnV6de Uq7sQllGGO90OjAUJQ3Rxs0ghU0nc1QsAaE3QVnA5g== X-Google-Smtp-Source: ABhQp+QnPPoKptXr6RzIN7Y+Qe3ADFgaZ9eOpSdWWcuHCLpaKS/5oPjUjN/2RwRO6MDx9iZI84n/npl41WUo+jpC1k4= X-Received: by 10.31.15.13 with SMTP id 13mr1516789vkp.191.1509591514469; Wed, 01 Nov 2017 19:58:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.80.169 with HTTP; Wed, 1 Nov 2017 19:58:33 -0700 (PDT) In-Reply-To: References: From: Craig Ringer Date: Thu, 2 Nov 2017 10:58:33 +0800 Message-ID: Subject: Re: MERGE SQL Statement for PG11 To: Peter Geoghegan Cc: Simon Riggs , Robert Haas , Michael Paquier , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" 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 1 November 2017 at 01:55, Peter Geoghegan wrote: > The problem here is: Iff the first statement uses ON CONFLICT > infrastructure, doesn't the absence of WHEN NOT MATCHED imply > different semantics for the remaining updates and deletes in the > second version of the query? You've removed what seems like a neat > adjunct to the MERGE, but it actually changes everything else too when > using READ COMMITTED. Would these concerns be alleviated by adding some kind of Pg-specific decoration that constrained concurrency-safe MERGEs? So your first statement would be MERGE CONCURRENTLY ... and when you removed the WHEN NOT MATCHED clause it'd ERROR because that's no longer able to be done with the same concurrency-safe semantics? I don't know if this would be helpful TBH, or if it would negate Simon's compatibility goals. Just another idea. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers