Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 35F2E1337BB9 for ; Wed, 16 Mar 2011 06:35:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 23430-04 for ; Wed, 16 Mar 2011 09:35:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rs73.luxsci.com (rs73.luxsci.com [64.49.254.135]) by mail.postgresql.org (Postfix) with ESMTP id C37EB133616B for ; Wed, 16 Mar 2011 06:35:25 -0300 (ADT) Received: from GNANAM ([180.151.61.10]) (authenticated bits=0) by rs73.luxsci.com (8.13.8/8.13.8) with ESMTP id p2G9ZMlK001795; Wed, 16 Mar 2011 04:35:23 -0500 Reply-To: From: "Gnanakumar" To: References: <006f01cbe21f$35a217b0$a0e64710$@com> In-Reply-To: <006f01cbe21f$35a217b0$a0e64710$@com> Subject: Re: Temporary table failed to drop after power failure Date: Wed, 16 Mar 2011 15:01:37 +0530 Organization: Zoniac Software Private Limited Message-ID: <002f01cbe3bc$f4af5840$de0e08c0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcviHzPTSFhoCeOISTuwecxeuEuASwBnaORQ Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201103/188 X-Sequence-Number: 37060 Any ideas/recommendation? -----Original Message----- From: Gnanakumar [mailto:gnanam@zoniac.com] Sent: Monday, March 14, 2011 1:40 PM To: pgsql-admin@postgresql.org Subject: Temporary table failed to drop after power failure Hi, We're using PostgreSQL v8.2.3. Ours is a web-based application, language is Java and we're using pgpool-II v 2.0.1 purely for connection pooling (we don't use other features of pgpool like Replication, Load Balancing, etc.). We're creating temporary table using "CREATE TEMP TABLE FOO(col1, col2, ...)" and it's being heavily used in one of our application report. When the report was still running, suddenly there was a power failure and PostgreSQL was stopped abruptly without proper shutdown. Now, if run the following system catalog queries, I can see that those temporary tables were not dropped really: 1) SELECT schemaname, tablename, pg_size_pretty(size) AS size_pretty, pg_size_pretty(total_size) AS total_size_pretty FROM (SELECT *, pg_relation_size(schemaname||'.'||tablename) AS size, pg_total_relation_size(schemaname||'.'||tablename) AS total_size FROM pg_tables where tablename = 'foo') AS TABLES ORDER BY total_size DESC; 2) select * from pg_stat_user_tables where relname = 'foo'; Now, how do I fix/handle in this situation? Although this happened within our staging environment, I look forward to experts advice/recommendation before I conclude anything. Regards, Gnanam