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 1gfZOX-0001qC-BH for pgsql-bugs@arkaria.postgresql.org; Sat, 05 Jan 2019 00:00:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gfZOV-0003j5-1F for pgsql-bugs@arkaria.postgresql.org; Sat, 05 Jan 2019 00:00:51 +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 1gfZOT-0003hU-9n for pgsql-bugs@lists.postgresql.org; Sat, 05 Jan 2019 00:00:50 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gfZOP-0006p4-F2 for pgsql-bugs@postgresql.org; Sat, 05 Jan 2019 00:00:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 977FE1588; Fri, 4 Jan 2019 19:00:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 04 Jan 2019 19:00:43 -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=oVAr8mcend9PJhtFkFRLAZR4DGx 4PhFLIlX4ZkBe4nk=; b=sa1UmVbVohoR5cqqLZnDTuYO90AFyfEzPFUoS7FPUV4 076MUXyUbIm64sri0xEZk6HymB9MLCkRVoyIwdHdmig+cp4aeZwOFoTILbgXzdN7 ByUhWtWfQ3RG4FP2N+M1zMLhYQBeKVigPHiav63d19Q6/+npz0oDl0EV18kRB/I2 x3yHuKebhiRssXoan29NZAbNK+uc+zqWOt7qH9c36iytD5HaEZgzrX2KOX2K6pAQ Sxczq26eE2EDeSlGGe5CxWZ9WWBos1OV/ZZzUaZVwPiR9xmzYGv2sYRi9szFvNMG kifr615miElXbkwp2j9Kz1cSVtBNW0oa/F9lYX/BWTg== 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=oVAr8m cend9PJhtFkFRLAZR4DGx4PhFLIlX4ZkBe4nk=; b=t0Vx8GA7czIFk91pNftIXz sdatUGvTjtwScKseESaDbl6bndX6B4WfCngpUfaBfoeA1NnqqZyJ0cyGi1R/ticZ T9JRx5QPsuqniHDkI018xhEkqUaPbszMisXoP5zxvMDOAQf5hCivNCeF8yw+z5Em oj++jWGuePY60fj515pbrPL6lSPeWFngqx+mdzCeMKp67uDRq2jMywxIkR6PW2n4 90hGR7WA3tiP08FEjQw+S9WrfU/Wzmq3OsJkzpBSc6K+tziFCH82sb8SE/8UzQFI CfGIa7dWmUh5r/frX/GIDX/HxAsz8jZJ6cc+VbWmwnTsLs5pimtOjW5XW842erEQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvddvgdduleculddtuddrgedtkedrtddtmd 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 7EC77100E5; Fri, 4 Jan 2019 19:00:40 -0500 (EST) Date: Sat, 5 Jan 2019 09:00:37 +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: <20190105000037.GA1626@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> <20190104131351.GF2067@paquier.xyz> <9176.1546613679@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" Content-Disposition: inline In-Reply-To: <9176.1546613679@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 04, 2019 at 09:54:39AM -0500, Tom Lane wrote: > Hm, I had forgotten that we had such an error message. Really that > restriction needs to apply to any object in the temp namespace, not only > tables. The cleanest way I can think we need to set up the flag each time InitTempTableNamespace() *could* be called. If myTempNamespace is valid, the routine may however not be called. So an idea is to return immediately from InitTempTableNamespace() if myTempNamespace is valid instead, which would mean removing its assertion at the top. Using a wrapper on top of InitTempTableNamespace() is also possible but I think that we should design things so as only one code path sets MyXactFlags, and one good thing is that InitTempTableNamespace() is the only code path setting myTempNamespace. For the tests, it is possible to use "\c -" to enforce a reconnection which would be able to discard the previous temp namespace and allow reproducibility, however as this problem applies to any objects which can be schema-qualified this is not necessary for all the tests. I think I can get that worked out with a back-patchable approach, still it looks a bit sensitive because of the creation-pending logic which relies on the assertion at the top of InitTempTableNamespace, which is a case we may want to handle with an extra flag for the caller of InitTempTableNamespace(), aka "fail if myTempNamespace is valid instead of just returning back". -- Michael --ReaqsoxgOBHFXBhH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlwv86UACgkQnvQgOdby QH33QA//WrofS1aoy+ZeXmPWOOhR0a4W+tyBif8/53azd4bx3yPMfHE/zJYc7NqT kd46ZTYjF2gdM9l0RhBR5NOjRZb2EFKrdsx1vhPDwVG2m5IkdE6guX1UqUs6kfat Ia6Y9Y230DzEvK4hpwT/dpOwfDp4pG0o6kqenfrP4GgY1ArrGdMskCF1XQ2VIA16 H09DemxoaqodFSL4c3eQ6/HqP6SviZOsHYK1OMdSnzcDsbAge8wpjFwmKZDFnd7J qUGGBANk5ZH/b9XW+x7ZEVyL7jzuRGnXfAsj+GCQM/Hu8IqE6s2pRYcmnlSWz43e i+XId5StYCdewIMIVFFwfzwh5gLzugzOadik9wGK8RLTRA57a96eT1VqlgMJ+VoM LbUP1cTBP3kGEBOtxGjPLbGGwEc/HrtAlJh+XTMPdlKMENo8hjUVgrtrGeXGpYIP Zl3dQKKcKuwM1IhpNzgF2PdLTnTUelrzGQHT+EJuITavv9zTvfl1mz8Tv6wQZCZb cPJy9ar/iFzGS46RECtr3pIttlbOImnQa8M8rOhZcgx00tBvbwXNT8/83COW4pye YGG4TElRmAbOXClEZLLmQZ+H1yXo1jHbFkPw9oLiDIblsQzj7tE/hRzDo/+fhkDe mLJV3KHMmmfiSe02Rz2Au6sqaN4C/esHV3z7o50sGOSxblgWClU= =zzrf -----END PGP SIGNATURE----- --ReaqsoxgOBHFXBhH--