Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hajIR-0000GJ-Cc for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jun 2019 16:06:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hajIP-0001UM-V9 for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jun 2019 16:06:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hajIP-0001UF-Mb for pgsql-hackers@lists.postgresql.org; Tue, 11 Jun 2019 16:06:49 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hajIK-0007AV-FA for pgsql-hackers@lists.postgresql.org; Tue, 11 Jun 2019 16:06:49 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1D035414; Tue, 11 Jun 2019 12:06:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 11 Jun 2019 12:06:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=yXA+m5M4xmyxV9vqFetzRzYqMww wVbGV5pY4w0AgWsI=; b=04VVC211efbGidc4hGzXED0BvP+iMO4962zGGDHuARJ 88zqL6Nwnn2E1DNTX0CCsVMGfWA4s9mcTloZZo02b184hOtH7dsZgJDl+zEJJgk5 75iZmcUUyia8AlwN2hjUbS3baA+uvq/oyQgBLyQtr7q92MTeqbwZcLw1nJ/sjySl ux9UAorf72j51TXJEsws3a3XRaPPEBWBG9oknnLwAaxtLPYWCBU3exjbaM5UcHJJ CXozcJ3FbvsnX/tNVRAP7NtAxqvvDSV4yGpF2Y3fYgYaO9ucnzwjXjxdQQNUgy5r e/Stk1nV9gg+lCx59dhowj1lNPpTYWzKfnwpvNNYzMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=yXA+m5 M4xmyxV9vqFetzRzYqMwwwVbGV5pY4w0AgWsI=; b=VuvWaH48ETFlpa0tmxrM1l ju/KiRLl2i4kh0r5xNGGcOBv/Ncu36mgUIJEtiSIlf6wNqzkkBQ953AGnPoqYHeT jCskwWfci4UEP0ciO4PP9EcvQpMADI6l6ku5af7lh6k7M+ukl4Y12sKDizqqgnHM AG7feJi/W3SARLuHwl78bDCqfIJYVTr+hwk9A6zGeYemPIB8iX+a3r6XkV61nUmM cyvM4T7hLy1C9aS0OnTGITH5LD9SOoaCTUGH7ZyneilrqTMJ6a9Dv0ze/lx0D1Eu a1xKJYTo2ptwHyJfdj7PWsZmdm6FUyaTXsjbE+qT9IAdlb99ddv10siQfFlCwmew == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudehhedgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepie ejrdduiedtrddvudekrddvfeejnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgv shesrghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-218-237.hsd1.ca.comcast.net [67.160.218.237]) by mail.messagingengine.com (Postfix) with ESMTPA id DB4BA8005A; Tue, 11 Jun 2019 12:06:40 -0400 (EDT) Date: Tue, 11 Jun 2019 09:06:39 -0700 From: Andres Freund To: Robert Haas Cc: PostgreSQL Hackers Subject: Re: aborting a non-speculative insertion Message-ID: <20190611160639.wozdjnewje52pb7g@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-06-11 11:47:07 -0400, Robert Haas wrote: > On Wed, Aug 17, 2016 at 8:06 PM Andres Freund wrote: > > This commit updates the heap_abort_speculative() function which aborts > > the conflicting tuple to use itself, via toast_delete, for deleting > > associated TOAST datums. Like before, the inserted toast rows are not > > marked as being speculative. > > I just noticed how crazy this is - not the commit itself > (07ef035129586ca26a713c4cd15e550dfe35e643) but the thing which the > commit message describes as pre-existing behavior. Apparently, even > if the insertion wasn't speculative, you can still abort it just as if > it had been, at least when we're talking about a TOAST table row. Not > that I have a better idea, but are we sure that's the way we want to > go? Well, less "we want to go", and more "have been going for ~five years"... I don't think I immediately see - or saw back then - a realistic better approach. I guess we could add a flag that somehow signals that a plain delete should accept an invisible tuple as input, but that seems dangerous too. > This is relevant to my little project to make the TOAST logic reusable > by other AMs, because the comments in tableam.h suggest you can only > complete a speculative insertion if you've previously performed one. > If we allow any AM to be used to implement a TOAST table, then it > needs to be documented that such AMs have to cope with this kind of > case. Hm - you're thinking of making the case of toast AM and main AM being different working? I'm not sure I'd otherwise expect to again go through the AM, although I'm not sure about that. Greetings, Andres Freund