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 1ha5Pd-00050l-Ig for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Jun 2019 21:31:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ha5Pc-0002Zf-0b for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Jun 2019 21:31:36 +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 1ha5Pa-0002WU-S4 for pgsql-hackers@lists.postgresql.org; Sun, 09 Jun 2019 21:31:35 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ha5PW-00066x-Nt for pgsql-hackers@lists.postgresql.org; Sun, 09 Jun 2019 21:31:33 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E53FC21321; Sun, 9 Jun 2019 17:31:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 09 Jun 2019 17:31:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=Ftv1jeBtJmZTotFAete+IIe+dmP FXhUycIhCQjfLZ0s=; b=cx+JT88RZ40ue8px7I9CEe1TC40fD5M/urq6ufN0UH5 TwpwbNHwhfFaDiBlXZDI/15bi9/fhpN5rHN3Fb/dSo1HbZSmO7hMBcDbS0afTG5M +71z14L+htTj35D3/EstbyB1QIT8VO08OPzscFwXl3NvOR9gtzTDkH/F9MIhnXac A8Rr9VUjX0zxhO9X+VVg1OkuzaLi270W/3X25iFs6VSraGO6IBz4lmzmVcoMo5zi UfR/Gv1vedEfNlP+rS2XCWLSUCBagDoqzjO5yHBE/ZStub165+sdKexrC+T9tkHb u0EoHljfOJf1aq+/JNygFjRl3wccC/LHfwAIsZd45jg== 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=fm3; bh=Ftv1je BtJmZTotFAete+IIe+dmPFXhUycIhCQjfLZ0s=; b=GI7tTQCWpgmzM/E/QTNlgs XpmLhZngKS9BXE1k9Ohc8QrBS66fT7ztdxglAGTNsWKum+I86NIyE+G7uKzs59Pm 0gN3vg0ivaVZVmjEsML7RdGBaqPSYc8SntubO/L+4cNT3xzv6vHaI/G8JeHBQP9W mh1ymyskJ73CGnlTXuBzWTsQbG4w40w9yrf+k6vsNEZExC3yL6k0zY1e2f9OQXMQ WPifUpTzVkXGHVuz5abnxGxV7f+ztF4gQxiUo5wM1p+YkhNJP6kyrvCi+Cf0ttdI CnGuqJXTLXZMkuV44av7ACuj47neVEeZ8C0HlHjmJvnQJlevHERIi/AKx8rMoyXg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudehtddgudeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecukfhppe eijedrudeitddrvddukedrvdefjeenucfrrghrrghmpehmrghilhhfrhhomheprghnughr vghssegrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-218-237.hsd1.ca.comcast.net [67.160.218.237]) by mail.messagingengine.com (Postfix) with ESMTPA id 3AE7780062; Sun, 9 Jun 2019 17:31:28 -0400 (EDT) Date: Sun, 9 Jun 2019 14:31:26 -0700 From: Andres Freund To: Thierry Husson Cc: Michael Paquier , Robert Haas , Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: Temp table handling after anti-wraparound shutdown (Was: BUG #15840) Message-ID: <20190609213126.uutlkqlrsud3bdfs@alap3.anarazel.de> References: <15840-06c9565bfd8099f6@postgresql.org> <20190607190231.6psb6w3bvlod7lvk@alap3.anarazel.de> <20190607145911.Horde.MKizKAnShw4nKEYGDUC2M-T@webmail.iciel.com> <20190607201002.cado5goe3rcup43n@alap3.anarazel.de> <20190607164027.Horde._egTUMJMTDBA4f31sPYgl_J@webmail.iciel.com> <20190607225843.z73jqqyy6hhc6qnp@alap3.anarazel.de> <20190607235937.GA1590@paquier.xyz> <20190608002632.ptuvc6tbffjhlsgi@alap3.anarazel.de> <20190608014540.GC7228@paquier.xyz> <20190608040639.Horde.mXgiHVLprn9sAsYXLi6I9up@webmail.iciel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190608040639.Horde.mXgiHVLprn9sAsYXLi6I9up@webmail.iciel.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, (on postgres lists, please do not top-quote). On 2019-06-08 04:06:39 -0500, Thierry Husson wrote: > In fact, I suppose all temporary tables and their content could be > completly ignored by MVCC principles as they are not subject to > concurrency being unmodifiable/unreadable by other connections. That'd cause corruption, because vacuum would then remove resources that the temp table might rely on (commit log, multixacts, ...). > The separate situation, as noted by Michael, could be done at connection > time, when PG gives a temporay schema to it. When it create a pg_temp_XXX > schema, it could make sure it's completely empty and otherwise remove > everything in it. That already happens, but unfortunately only too late. IIRC We only do so once the first temp table in a session is created. > I already had a DB corruption because system tables weren't in sync > about these tables/schemas after a badly closed connection, so it was > impossible to make a drop table on them. So it could be even safer to > clear everything directly from system tables instead of calling drop > table for each leftover temp table. Hm, I'd like to know more about that corruption. Did you report it when it occured? Greetings, Andres Freund