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 1i2fiJ-0002FI-D1 for pgsql-general@arkaria.postgresql.org; Tue, 27 Aug 2019 17:57: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 1i2fiH-0003CS-Dd for pgsql-general@arkaria.postgresql.org; Tue, 27 Aug 2019 17:57:01 +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 1i2fiG-0002zC-Gr for pgsql-general@lists.postgresql.org; Tue, 27 Aug 2019 17:57:01 +0000 Received: from resqmta-ch2-08v.sys.comcast.net ([2001:558:fe21:29:69:252:207:40]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1i2fi2-0007RM-IO for pgsql-general@postgresql.org; Tue, 27 Aug 2019 17:56:59 +0000 Received: from resomta-ch2-08v.sys.comcast.net ([69.252.207.104]) by resqmta-ch2-08v.sys.comcast.net with ESMTP id 2bVbiFd0eisqZ2fi1iUgPy; Tue, 27 Aug 2019 17:56:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1566928605; bh=Hz4JinHAa/8PnQHYMTFrMZfwkqKpQoWvMi7swfB2aWM=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=l9YbGueLNQwan0GYHQq78hYrlitmu1+mVNFKyAjThFoTJzktiAaMHaNdeD+c4ozpJ KGirg7UicOt0YULUnCZ2oFKV3PtxW/orV/Z/tEdtZrtTsblXG6ulqjO0gvrYHVjqkP OEQamQPQWsHQTJSHayHEdJtZZyXuYQabNokaE6e7Kj9mjlZRup/7yf5LFoAI/xWkLs ltMyJm9JIcXfse2WlwpNfi84vMpr8WJh12lYmdedSYa15EeCY/7jQV4moRPSxEc0f1 6aXSeg9qMkzC+QtdiCvn091jqKZ6tyBnQWr2IMgLMoemPEeHt9xPWh+TjcwJZcp8Oi FTEzRa7gS+u5A== Received: from jsievers.comcast.net ([12.187.116.132]) by resomta-ch2-08v.sys.comcast.net with ESMTPA id 2fhrixgUtTsL52fhsiRuwr; Tue, 27 Aug 2019 17:56:43 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgeduvddrudehkedgieekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuvehomhgtrghsthdqtfgvshhipdfqfgfvpdfpqffurfetoffkrfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkfgggtgesthdtredttdertdenucfhrhhomheplfgvrhhrhicuufhivghvvghrshcuoehgshhivghvvghrshduleestghomhgtrghsthdrnhgvtheqnecukfhppeduvddrudekjedrudduiedrudefvdenucfrrghrrghmpehhvghlohepjhhsihgvvhgvrhhsrdgtohhmtggrshhtrdhnvghtpdhinhgvthepuddvrddukeejrdduudeirddufedvpdhmrghilhhfrhhomhepghhsihgvvhgvrhhsudelsegtohhmtggrshhtrdhnvghtpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-Xfinity-VMeta: sc=0;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 9B8AD26005A for ; Tue, 27 Aug 2019 12:56:35 -0500 (CDT) From: Jerry Sievers To: pgsql-general@postgresql.org Subject: No warning/error trying to vacuum other session's temp table Date: Tue, 27 Aug 2019 12:56:35 -0500 Message-ID: <87zhju7ar0.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 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Greetings! Spent a bit of head scratching time today responding to a case of old temp tables possibly threatening one of our reporting systems due to txid wrap. There is such an old enough backendID still live that I speculated one or more of these temp tables still possibly in use... which got me to dreaming that I had once or more previously vac'd such tables from another session. And then tried it. As seen below, the command response VACUUM is output , but adding the VERBOSe keyword results in no additional output. Thus I believe this doesn't work, and never has?? An attempt to trunc such a table as shown in the test case results in a clear error. None of the conditions such as old xact/prepared-xact nor rogue slots that would prevent vacuum from advancing a table's relfrozenxid were found to exist. Please advise. Thx >select oid::regclass from pg_class where relname='foozzz'; oid ------------------ pg_temp_9.foozzz (1 row) -- not my temp table >\gset >vacuum verbose :oid; VACUUM >truncate :oid; ERROR: cannot truncate temporary tables of other sessions >drop table :oid; DROP TABLE -- my temp table >create temp table foo (a int); CREATE TABLE >vacuum verbose foo; INFO: vacuuming "pg_temp_19.foo" INFO: "foo": found 0 removable, 0 nonremovable row versions in 0 out of 0 pages DETAIL: 0 dead row versions cannot be removed yet, oldest xmin: 5756854 There were 0 unused item pointers. Skipped 0 pages due to buffer pins, 0 frozen pages. 0 pages are entirely empty. CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s. VACUUM >select version(); version --------------------------------------------------------------------------------------------------------------------------------------------- PostgreSQL 11.4 (Ubuntu 11.4-1.pgdg16.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, 64-bit (1 row) > -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net