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 1gkeBj-0005sT-Pf for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Jan 2019 00:08:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkeBi-0008JW-CX for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Jan 2019 00:08:38 +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 1gkeBi-0008Fd-4E for pgsql-hackers@lists.postgresql.org; Sat, 19 Jan 2019 00:08:38 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkeBf-0007L7-Ca for pgsql-hackers@lists.postgresql.org; Sat, 19 Jan 2019 00:08:37 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E65EB2680D; Fri, 18 Jan 2019 19:08:33 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 18 Jan 2019 19:08:33 -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=nWvjtkoRva+lFMEpHFPIrXSc+In 3IqpltwGbsm1wqqw=; b=gA+nMQ2iwdABEpwSRr5UDy1IS1R0IFlT4KODSdsBWWh W/P/QYoc76AAOVZaXqjpbhXcd55N/mVvT3K+MOZdZ1Vinxk3pn6XFxp3u3Vw1Hzm MF8QSdvRnr9xc1Sh7NUd4KAlBlRT2J5T6dfl7z+bH5yvztdH2ikRNEYxWnBFufEc fv+aBL57rlwgg+FAmcAMVKmBgJLgA6VnUzczEhxVPErVfNLjr9nbNic/ZBVUXPLz TvD+v1oEcDEYD8Bh5ebZo1xzad/vVkaS/41WId9hfDi5shqqE9916fAnkWBezyKc 2qpg6HGWCaH2Lml4iRnOAYNvy/Ycctyd1Cd8VUD6u7w== 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=nWvjtk oRva+lFMEpHFPIrXSc+In3IqpltwGbsm1wqqw=; b=viipKUzHlrEeHTSBeDIzaI nsgMos+9UKRbNCPdMLXa7bp+7BzaaRJsjV9ASzCBRiK2Tk14ArkHZ+VTvil4JZrz MNfMbkta33IBxn/xv+KEqsC2FnfNPYN1AvXp5Loa0p/V917ZEATYYWiw5piubFlX AFh9FRBT1/dsu4R4Sqn/N4UeO2L6Yx36KPBRjki376JPWo5xzj06yMhUi0i2A2ck 6zVgQ2XRFcWlpX7tU1c5FcuObRtVV/mHRAWFTdTdl1G+4QGrnS8c6qz8oEry9GBF OPQqW3G/GLAkBUIVfudMd0wHlyHJZBXsPAZ1rnwWRr98jfTRHRe1+NwF+3DworbA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrhedugddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdljedtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghh rggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenuc fkphepiedurddvudehrddufeejrdduiedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehm ihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluhhsthgvrhfuihiivgepud X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 89924102EE; Fri, 18 Jan 2019 19:08:31 -0500 (EST) Date: Sat, 19 Jan 2019 09:08:27 +0900 From: Michael Paquier To: Tom Lane Cc: Robert Haas , PostgreSQL Hackers Subject: Re: pgsql: Restrict the use of temporary namespace in two-phase transaction Message-ID: <20190119000827.GB2660@paquier.xyz> References: <20190118005949.GD1883@paquier.xyz> <25291.1547773687@sss.pgh.pa.us> <499.1547843670@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QKdGvSO+nmPlgiQ/" Content-Disposition: inline In-Reply-To: <499.1547843670@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --QKdGvSO+nmPlgiQ/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 18, 2019 at 03:34:30PM -0500, Tom Lane wrote: > Seems hard to avoid. We could conceivably make it return "pg_temp" > for the temp schema instead of the schema's actual name, but it's > not very hard to think of ways whereby that would make use of the > result fail in contexts where it previously worked. CREATE EXTENSION is one such case. It would not work if referring to the synonym pg_temp, but it can work if using directly the temporary namespace of the session. So I feel that changing such things is prone to break more things than to actually fix things. > Another idea is to force creation of the temp namespace as soon as > we see that search_path references it. I'm not very sure exactly > where would be a convenient place to make that happen, though. > There are paths whereby the GUC's value will change outside a > transaction, so we couldn't tie it directly to the GUC update. This is documented at the top of namespace.c: "initial GUC processing of search_path happens outside a transaction". -- Michael --QKdGvSO+nmPlgiQ/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlxCansACgkQnvQgOdby QH2emg//TJ60oiBjaJHbu1o6yJJvf+eZKyaKTdyX0pKXXeqFVlOG6xjZRo8r0W2n m3jtbiOTIME0qeMahwasUofoOpy3lMO600nvkER7j/M45/a7lti8CbeOvo0lHc0H vWLtMVA0bi7WuSs+xpUWyJw4ZSeU0y1xzhPU4I/2HaDIcdl4qNbJJKNHU5dviWdn bxNSPklSpQkrzOfbGIGPamR5lnjE/EJsJCLOB7Zfh8E++Tzv7wv78KsCFa1IvUQ0 Opei/OqDj/M9VBIn9NAltetjgO93xYRcZWNMjfJoVRyWAK4pxlWvA2jIxPPIkq30 M/kTVV3daf9bgEcIwNZF/P71kY+UYOziFP7V3ensstTISXZHjVp24It8aReW0DKD 588Tga6t5ZByRbIk+LJshdQe1JO9luAFpsobvlwvLTnmps6b/VaUhbOcruao9E4d LgaQO4tRnrEX1zDKxhXLNeM6iYsuRRKNue88f8AiU7EwP3tDpfRRwmNK7ko34Al6 SuKJH2zKsczbrNiu7fvEPt4x7IO9y1QM3wpHVljeB5HnEyyytPqm5uKZswIwc8aL sZRIbaTynua8Iv8qWSkaiZYcwGioA4QIMjVyG/T4uZuUkSsusTj3FJV0qu3/eRvS t3mVWwWBWFjS6CjtHy7Ebb2BD0OO5k5PySKO/3NV/cWgHrHfszU= =wR3g -----END PGP SIGNATURE----- --QKdGvSO+nmPlgiQ/--