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 1gfRdR-0000cy-D6 for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Jan 2019 15:43:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gfRdP-0003mq-Sy for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Jan 2019 15:43:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfRdP-0003mj-FX for pgsql-bugs@lists.postgresql.org; Fri, 04 Jan 2019 15:43:43 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfRdM-0003ub-F4 for pgsql-bugs@postgresql.org; Fri, 04 Jan 2019 15:43:42 +0000 Received: by mail-qk1-x744.google.com with SMTP id y16so21705912qki.7 for ; Fri, 04 Jan 2019 07:43:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=QPJMDFTIzhzWT2O0auONVInSwHnjxOCvKMS6UjKTjVk=; b=OPwVIgoOERgw4NAiCgvxNXi9Whz9XwrsqNUuHGVG6fyMOat2shCe6FYkKyOQZ8YUON Q9v0/KrEW/rCGxIjOXGzuxfYI4Hhx9kZlR2J+OtRA/llJkHVPC4wi2i6zRepjwQjE9PD MdtBQRwL5YdgGp9jZiyFWVawubpo11nagEVv3E1Yvr16z8EIdjqyul09mN1WOfjzrxDb PZQckBcJUljalwm5Nwf5IKuDhD686PwpoHgcInvePmmo9AJScF7sGulNIirFe1wrep68 dZ/XGJeVOhMaNRNpRcpGYlYjwrYTvZB4Bm8oXRd1OjBRskdYKZf1GpWRYgWnMIjgzOX6 ixuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=QPJMDFTIzhzWT2O0auONVInSwHnjxOCvKMS6UjKTjVk=; b=aR5rXt+RQPSAfm12ceZhIr1XwalpXSjKsEt80G9OZPxzutkSIn4TC7cb8UgCMShNkX VEBqQNrGMwyPBJU716HcSdME1tiPpuayEbcfq3umjR4CXTmY5Df006oO1oGPfQ5eRU0g BoOqjG0VXwxjn/tqk4Hnh5/6Oth4uu1IU0Aa8PBNVrpmISAEOCJQ2sCec8rc9gckMh1X 2E4zU0u8Rpime+r0bFCKtDm9r0rbbfJgXJkR3LiQLBaow1Oh0MpI9IMVMleLczv0soX1 +XImNHcyWkyC615hBD3t9Ws7jaYxp6nMl2G8hwLLR/RWqEeWmD5P6ly6kWFpy3eaEO6O UDqg== X-Gm-Message-State: AJcUukfeRKwaDizAMtAVB+PS1GhmaOT2ikG0IdkOkKKlHBVTQRSlkucw 5g1w/cCb5uyE+2y8vUNKt5ikNQ== X-Google-Smtp-Source: ALg8bN5dWsm6o9Lcy4n6WRL9PGk3AE8uWI8vf60cSAETR0thTokdPo6PZHoX/qmVz1y32ENpTOiCug== X-Received: by 2002:a37:a5c9:: with SMTP id o192mr48402110qke.140.1546616619809; Fri, 04 Jan 2019 07:43:39 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id p72sm24997012qke.87.2019.01.04.07.43.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jan 2019 07:43:39 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 839ADA0F; Fri, 4 Jan 2019 12:43:37 -0300 (-03) Date: Fri, 4 Jan 2019 12:43:37 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Tom Lane , Alexey Bashtanov , pgsql-bugs@postgresql.org, mmitar@gmail.com Subject: Re: Is temporary functions feature official/supported? Found some issues with it. Message-ID: <201901041543.wdduitrlu2th@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190104131351.GF2067@paquier.xyz> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-04, Michael Paquier wrote: > That should not be allowed to commit directly. I think that we should > just add a new value for MyXactFlags which tracks the transaction > where the temporary namespace has been created, and generate an error > if trying to use 2PC in this case. That implies that a 2PC transaction will fail if it's run in a session for which the temp namespace doesn't previously exist. I think it's a fairly ugly failure mode, and one that normal testing will not catch because it'll occur very rarely. An app that detects this problem at run time will have to create a random temp object, commit normally, then re-run the 2PC transaction from the start ... a lot of code to deal with something that shouldn't happen in the first place. I wonder if we can somehow create the temp schema in a way that makes it immediately visible to everyone, and not depend on the commit status of the creating transaction -- say mark the tuple with xmin=frozenXid or something like ugly that. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services