Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aj5zp-0008Hd-PT for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Mar 2016 14:12:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aj5zp-0007rh-Bz for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Mar 2016 14:12:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aj5zC-0007Av-IP for pgsql-bugs@postgresql.org; Thu, 24 Mar 2016 14:11:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aj5zA-0006uY-1g for pgsql-bugs@postgresql.org; Thu, 24 Mar 2016 14:11:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u2OE3qRX022424; Thu, 24 Mar 2016 10:03:55 -0400 From: Tom Lane To: digoal@126.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14042: bug, PostgreSQL not cleanup temp table info after crash. In-reply-to: <20160324084508.2903.55060@wrigleys.postgresql.org> References: <20160324084508.2903.55060@wrigleys.postgresql.org> Comments: In-reply-to digoal@126.com message dated "Thu, 24 Mar 2016 08:45:08 -0000" Date: Thu, 24 Mar 2016 10:03:52 -0400 Message-ID: <22423.1458828232@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org digoal@126.com writes: > When PostgreSQL crashed during database have temp table, database not > cleanup the temp table's info in pg_class. This behavior is intentional. > and there is some bad thing, if no one create the same name temp table after > restart. this temp table will a zombie in pg_class, and vacuum freeze cann't > reduce it's age and database's age. This is not a problem, see the code in autovacuum.c: /* * We found an orphan temp table (which was probably left * behind by a crashed backend). If it's so old as to need * vacuum for wraparound, forcibly drop it. Otherwise just * log a complaint. */ In practice, such tables will go away the next time some session uses the temp schema containing them, so their lifespan isn't likely to be nearly long enough for this code to activate. But in any case, they won't create a wraparound hazard. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs