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 1gfPIa-0007CL-6J for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Jan 2019 13:14:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gfPIY-0002f9-Rz for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Jan 2019 13:14:02 +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 1gfPIY-0002f2-Lk for pgsql-bugs@lists.postgresql.org; Fri, 04 Jan 2019 13:14:02 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfPIW-00043L-Hb for pgsql-bugs@postgresql.org; Fri, 04 Jan 2019 13:14:02 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 39EE1143F; Fri, 4 Jan 2019 08:13:58 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 04 Jan 2019 08:13:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=shxykpyd39YUIIbyAe4/867NmWH OOJUGi3RuSoRa9i4=; b=wdPMwgpco2usuEFDaMKoq8u2ZzyEdrMhICoK6bUjRiQ CV+DHIgFO0Pz/AEa5kjttlfFdhC2jghji190MZuHZqi3IJs7dFVI9RPH7/VCs2Zn QJYcf+zkjbCutwiWLOFq7MyFs5bsI9aGihXLQja6a0LcNITvGS7BM4nD8Iq4VlIT N9UZigKZmTJk6igoC50JvDh295V2j+ky+EiYgwsY+HG4MrH5S68mi+wI2yh8OwVu unhpJ0JVTvTl8r2Q+csgV9/zpsUzuaE6EdXLv6urPGww7gunCDa5z8IVWq2+PTZ2 08pRj3dGmo3MRIqdxoRb/jHeDio/ro+rsXbBrd9GjGA== 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=fm1; bh=shxykp yd39YUIIbyAe4/867NmWHOOJUGi3RuSoRa9i4=; b=cibETBlI5WlsHBfgxCheBk GO1N6Fk4QGcSysetYv2wOXRGxUaBH//3pr2f5iEqtXkRLYK1uWLAVOW4IGnnobda IQr/iZw+42RNGCM3nEpxorhiUVA75PqXqjDyGdwVxzPGtGFaNJryWAmDRuqi5h/e +4+J040KF5ADHnoB9PhYnpRj4smdb9eYhFM4nh2rzqPaiLUMtSRyEPfpOR6HVG/k cO2ZPTC/YTVLuSwIkj+5EzYUdMIjmkrXbg245sK3w7fVMjSqVVK93uWG3r66/g1+ 15SnynprSLLrjIKTrUduxw2q4ivT/hk1MeGPXoWiNmI2gK63BczkfNE5CUYPbfVQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvddugdegleculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepiedurddvudehrddufeejrdduiedvnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 6D910100BA; Fri, 4 Jan 2019 08:13:55 -0500 (EST) Date: Fri, 4 Jan 2019 22:13:51 +0900 From: Michael Paquier To: Tom Lane Cc: Alexey Bashtanov , pgsql-bugs@postgresql.org, mmitar@gmail.com Subject: Re: Is temporary functions feature official/supported? Found some issues with it. Message-ID: <20190104131351.GF2067@paquier.xyz> References: <5d910e2e-0db8-ec06-dd5f-baec420513c3@imap.cc> <22938.1546456949@sss.pgh.pa.us> <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc> <10857.1546467488@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="twz1s1Hj1O0rHoT0" Content-Disposition: inline In-Reply-To: <10857.1546467488@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --twz1s1Hj1O0rHoT0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jan 02, 2019 at 05:18:08PM -0500, Tom Lane wrote: > Hm. I can reproduce this if I start in a virgin database, but not > otherwise. I think the problem is that the prepared transaction has > created the pg_temp_NN schema for its session, and therefore there > is an uncommitted pg_namespace entry for that schema name, and the > second session is also trying to create that schema (because it has > the same backend ID) so it blocks waiting to see if that index > entry commits. 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. A separate flag looks necessary to me so as we don't bump on "cannot PREPARE a transaction that has operated on temporary tables" in this case. That would be back-patchable, and if both XACT_FLAGS_ACCESSEDTEMPREL and the new flag are set then we just blow up on the original error message when committing. Opinions? -- Michael --twz1s1Hj1O0rHoT0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlwvXA8ACgkQnvQgOdby QH3Ftw/+Pa2fDjxCSpnPl/RvNhZCfG3TNl4FK+nSahh+t10jaaxx9NUveyT1848a CCfsr/Xv5Vo6ERizJXZjJ6AsOnlGfUwPYuXndXXDnXX4NgSBmREkm4+disqx0NZr wMX4wFkm/ex6odnhfFjQ30Dcw70Upq/5QOOAbyCngdFGN2FjzKmaUdAseVGbkbHN 9L8bQZjdIQfuAl8EhgMTxg2BlAbMu3QM4nhR5+2pfzEWvnSVew79pcmpJMIQPU2b x5a44o2XH6F2hDZJ+8UkozwJiZ0xDH49rWL2hBKesKehDKJDN4Etk+0KYbH4tN79 ptubhXOb2cONgWeVZ8lu/QNtd3ZaVTAFL+SuPu7y3a5RmSi1uRIk419eIjn5RRP+ v9pvoqvYlOvBITzwuSgwLAJ5pbVbeQ/kTP9HDHbMlGomRdJib+31oVDw6K65t5qY DCSUQ2Jqh9gcTeCTIC8rm61FmEuW615A4B38izRt4RzWiRy22jOif4xb5QExkEIj Zuj1JS/mdcLVOuHsFGmxyD4u7w7/2Al/78H1ieuu5E996IBkzSkbQhmN5H5ws9c4 mL4NxKE0WFO2Cg1NzxvFWgnFHPTVJE1A3OXHgjY2RPiBKS1RVLpJLnzNZ5Ooj1v2 5yyGqZL686wf8RhTzQ3X4c6Heka712mEXTbAkFU7//X3jXyGWs8= =uu0X -----END PGP SIGNATURE----- --twz1s1Hj1O0rHoT0--