Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQbzw-00015N-G8 for pgsql-general@arkaria.postgresql.org; Wed, 06 Jun 2018 17:13:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fQbzv-0007fp-CM for pgsql-general@arkaria.postgresql.org; Wed, 06 Jun 2018 17:13:23 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQbzu-0007ec-Lw for pgsql-general@lists.postgresql.org; Wed, 06 Jun 2018 17:13:23 +0000 Received: from resqmta-ch2-12v.sys.comcast.net ([2001:558:fe21:29:69:252:207:44]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fQbzs-0007eS-1w for pgsql-general@postgresql.org; Wed, 06 Jun 2018 17:13:22 +0000 Received: from resomta-ch2-12v.sys.comcast.net ([69.252.207.108]) by resqmta-ch2-12v.sys.comcast.net with ESMTP id QWNIf4fngg5tQQbznfQZrM; Wed, 06 Jun 2018 17:13:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1528305195; bh=KoaKv76iTk+Cyb7IGzPNOVy1w8me4sEj91dPU+025wI=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=VdqiOELUnY7qbFfRTFugDIg6SxxUZbcHAzp2dCUwAdqBCzpwGo42+wGFhTCJ321D0 w2R3hpP7u4C1hkMEJG9cdlhv0+Mokp6D0ITPNlMpF+bqkT20au6kcvSdvs6ngh/XGj arIw8ZWJBaU1jLb/YYbboCvBjnGxC4cMR/PJWT2afF7TL7uyyWSk3i8k7xvHgIW7hO vy0r9a1Mkjqe99C9uuVYDVF8VKpdxfno6THDO6EGYnqzEde+K2MlwK/k9ZCmElwBVS fOAy75X00vApir+4Hde3OUmakpNp8oMviirHJshgtqFTYaGCk3EnFh/OFmX84F6zNO 7lLeV+weY3zYQ== Received: from jsievers.comcast.net ([12.187.116.132]) by resomta-ch2-12v.sys.comcast.net with ESMTPA id QbzZfeWIJJxqiQbzafFhwD; Wed, 06 Jun 2018 17:13:13 +0000 Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 2E189260056; Wed, 6 Jun 2018 12:13:01 -0500 (CDT) From: Jerry Sievers To: Tom Lane Cc: Jerry Sievers , Adrian Klaver , pgsql-general@postgresql.org Subject: Re: Which backend using which pg_temp_N schema? References: <87o9go3nok.fsf@jsievers.enova.com> <81d847d2-59eb-0094-59cf-b91565213f44@aklaver.com> <87k1rc3ibz.fsf@jsievers.enova.com> <52ec7e75-9159-7879-fdeb-8d5d120b6ac9@aklaver.com> <877enbsyf3.fsf@jsievers.enova.com> <11089.1528301517@sss.pgh.pa.us> Date: Wed, 06 Jun 2018 12:13:01 -0500 In-Reply-To: <11089.1528301517@sss.pgh.pa.us> (Tom Lane's message of "Wed, 06 Jun 2018 12:11:57 -0400") Message-ID: <87wovbrg82.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CMAE-Envelope: MS4wfEXF8YtkwQueloifAP9YAidcIhGZNlT2XkE8hc6a1HbmDn9kV3QTFtw0jJ7Ipojlsdw3Gp1i8nMWBYZ/31ruS6lS9I/rvYdUbGv9O/pGozjrcnl2G2TI vNDfPScP1nEKpLjxx7x6YGkpznGBKIy2zj5DIkblRw5GvSnHOX7xTeh0CnxZDwVqqS8FHGMO886CslRHDk8zj1AET2qNhfXj7sWvrI4maiLmGPs08Fb+Wu7k CY4/o4MzfEik1af+/CxgKn9vg7sUWT+1QK78pzcKenJze6VQAjP193x73uXbylAj List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane writes: > Jerry Sievers writes: > >> Yep thanks... but IMO something that simply exposes whatever internal >> registry of temp schemas/PIDs (which I presume must exist) > > Not really. There are a couple of ways that one could identify a > session's "BackendId", which is the "N" in the "pg_temp_N" name of > the temp schema that it would use if it uses one. But I do not think > there's any terribly reliable way to tell from outside the session > whether it has actually done anything with the temp schema. If it > hasn't, then at least in principle there could be objects in the > schema that are left over from a crashed session that previously had > the same BackendId. We only make an effort to clean out such objects > at the time that a session first creates a temp object. Hmmm, interesting. > In any case, I think you're right that this isn't exposed at the SQL > level presently. Roger that and what motivated the post was basically to explore that issue. Thx > > regards, tom lane > > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net p: 312.241.7800