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 1ghRIA-0002is-5z for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jan 2019 03:46:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ghRI8-0001r0-Fz for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jan 2019 03:46:00 +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 1ghRI6-0001qs-VC for pgsql-bugs@lists.postgresql.org; Thu, 10 Jan 2019 03:46:00 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghRHx-00034T-R4 for pgsql-bugs@postgresql.org; Thu, 10 Jan 2019 03:45:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CC65222276; Wed, 9 Jan 2019 22:45:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 09 Jan 2019 22:45:47 -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=1YHKDALLTl9cI5ClkG4m28gHKG0 R9C7sqwJpx5MKmj8=; b=FZ9u0W2TRC5d0SjB01+pm4AkC+iEcr8vGnEo/Zgj6Pj Q8dCW6TsUBxz6hBuN0JdA5sMEqgqAiClad1HW/fxHrjyntUeIgt50YmVq+1GTlde Ftg1AFBAAckpjmhuXusgjGUNLCrD33PMNovawCbubdsOpSpu91vFEqU2NM+iMY3M UsRzPbR+0MD3SmolWNLolvKkB+UBUz7ngaiip/GBNzLFBpmr3m0naSlPtWscuQDB JC2vuTxNEPvxdI+trmB3x7bV1D7iZbcjOwdJhZ3CKM+BIZaiRY0mD4m/tP/Sl58Z bTWYcy8sQYJpgIt+7b0fYICOTpK/hsqSRrCaFCGx/Ug== 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=1YHKDA LLTl9cI5ClkG4m28gHKG0R9C7sqwJpx5MKmj8=; b=DeYph54i8mOcRAy5k1odip YGiQaaQum6EJg5HQixWAwRhLCYlWW/IY+D1qW9gU9d6bNCxvr2IqsUSZ0PQRPGWm njGlFxUzb1XALDAAuAF/cUfVhkHdXtvjmBH135+hOnVHZVrI5OLkLN5M0CNQGybJ 0ZC9VXsdqwIUEaLwqAS+VyWaSyuuSD6ahJWb490FlPPfy6Zq9B0xB6zCf1nAbJ9r vVTEEAQaHkOzolJUiZEnYDkXX5HhQ/cLKivKYorUb8nVgV0O8uYxElzNMCYt+fcX z7lbS7xSBwRn1gmaZLcDuJvMVflEwhy7I9V7nGVoPnnHnfn7IRKLKSfBU1PFEcwg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrfedvgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfeehmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghh rggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenuc ffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeeiuddrvdduhedrudef jedrudeivdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuih gvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id E3586100E4; Wed, 9 Jan 2019 22:45:44 -0500 (EST) Date: Thu, 10 Jan 2019 12:45:41 +0900 From: Michael Paquier To: Masahiko Sawada Cc: Tom Lane , Alexey Bashtanov , pgsql-bugs , mmitar@gmail.com Subject: Re: Is temporary functions feature official/supported? Found some issues with it. Message-ID: <20190110034541.GI2157@paquier.xyz> References: <22938.1546456949@sss.pgh.pa.us> <52794060-3339-e699-a8d5-e3dd7c81fa95@imap.cc> <10857.1546467488@sss.pgh.pa.us> <20190104131351.GF2067@paquier.xyz> <9176.1546613679@sss.pgh.pa.us> <20190105000037.GA1626@paquier.xyz> <20190107024211.GA22498@paquier.xyz> <20190109073011.GB23045@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6b3yLyRKT1M6kiA0" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --6b3yLyRKT1M6kiA0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 10, 2019 at 11:47:32AM +0900, Masahiko Sawada wrote: > Yes, I was confused that in spite of the relation is a kind of > database object we separate two cases, relation and database objects > other than relation. So I thought that we can merge these flags to > something like XACT_FLAGS_ACCESSEDTEMPOBJ tracking whether the > transaction created, locked or dropped objects such as tables, > functions and datatypes on a temoprary namespace. Sure. For HEAD I don't mind doing so and that makes sense. On back-branches though that's another story...=20 > I've found a corner-case issue with this patch; this issue still > happens when we create the extension on the temprary namespace, > because it can be done without accessing the namespace if the > temporary namespace is already created. >=20 > postgres(1:59232)=3D# create table pg_temp.e(c int); > CREATE TABLE > postgres(1:59232)=3D# begin; > BEGIN > postgres(1:59232)=3D# create extension pgcrypto schema pg_temp_3; > CREATE EXTENSION > postgres(1:59232)=3D# prepare transaction 'a'; > PREPARE TRANSACTION > postgres(1:59232)=3D# create extension pgcrypto; > (hang..) There is a reason why I have split that part into a separate patch and a separate thread:=20 https://commitfest.postgresql.org/22/1969/ The thing is that this behavior is rather unstable, for example I bump easily into that: =3D# create extension dblink schema pg_temp_3; ERROR: 42883: function dblink_connect_u(text) does not exist > Also, since even the current_schame() and the current_schemas() could > create the temporary namespace when executing fetch_search_path() > while 'pg_temp' appears the head of seach_patch, for example, the > following transaction cannot prepre. But it possible could be > acceptable by users as this is very corner case and it could be > regards as accessing the temporary namespace actually. Yeah, but the temporary schema gets created, which is something that we want to avoid, so 2PC must fail on that case as well or you would run again into the same locking hazards if the same temp schema gets reused in a different backend. -- Michael --6b3yLyRKT1M6kiA0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlw2v+UACgkQnvQgOdby QH1TaQ/8Ccceb5uBi2NxdTp9dcfTD/qPzs90Dpj/P98xcKWcsmj7NMwG7qqZz+S+ 4DuifJD15k3z2KgI8kgbn54ySm0wJuUX1X8mxhD2rhLrzRtBM4Be+KWtPRHPbl1J YfS5fIpZTU85ogMkC+xBWGIKmXtZXye6fy5OdsZRwULazw5iXfF7VUZ/G1seIhTJ GuFoSTa30z8bPm+hTDLeJPkADeiYUUzyNS17CTCvdO8z/sMjbq4y2l3Kga32of6j rJ/ZeunbVomjvqqAOmkOkZeNmCnNzxkHz5SnhpMRhPOplf97JAOjBb8d3pmTzvPp Vb0SrynSPCBixFMUy0RNUGkxbDRKK1m+OQiK6MVwv+f6rwbExJO5uE1hBN8CjnFo jiZzRWSmOA8W4Jwh8tiiHRX77zQsjdI069D5ycinsugvxcrFKMwcYjXdQoWYKx5N atEfe4VUUO5QxOOPKalL6+r3q2/mOOKp6OCExKrS2UEU0cIZbuock4bDGnvrizKY +E0nZdfG5FoeZ7E2AsKYxGHMCYnlbK7gHWK10hJZjbeZFiBrjaz8Vo9E2mXrb8T4 /4RJTs9GJzOtFaPrshrlPw0xYUFrr39Y4oN773wyLpROKvvDJe7igCHKkLTq6ZR9 RdRdI9cJNrVs+31Qy/B5DXpay61BsxDzxunwKbPlFu0PLAjNiEM= =/lAs -----END PGP SIGNATURE----- --6b3yLyRKT1M6kiA0--