Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C7649B5DBE6 for ; Thu, 4 Aug 2011 08:16:05 -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 53101-02 for ; Thu, 4 Aug 2011 11:16:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 074D3B5DBE8 for ; Thu, 4 Aug 2011 08:16:04 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p74BG4k9048659 for ; Thu, 4 Aug 2011 11:16:04 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p74BG4nR048658; Thu, 4 Aug 2011 11:16:04 GMT (envelope-from www) Date: Thu, 4 Aug 2011 11:16:04 GMT Message-Id: <201108041116.p74BG4nR048658@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6149: My table is empty but pg_relation_size(name) returns 39 MB From: "Shivakumar Ramannavar" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201108/45 X-Sequence-Number: 30857 The following bug has been logged online: Bug reference: 6149 Logged by: Shivakumar Ramannavar Email address: shivasr@gmail.com PostgreSQL version: 9.0.4 Operating system: open SUSE Linux Description: My table is empty but pg_relation_size(name) returns 39 MB Details: Hi Team, Though my table is empty, pg_relation_size(name) return 38 MB. I use below query to determine tables disk usages. SELECT nspname || '.' || relname AS "Table", pg_total_relation_size(C.oid) "Size", pg_size_pretty(pg_total_relation_size(C.oid)) AS "Total size" FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) WHERE nspname NOT IN ('pg_catalog', 'information_schema') AND C.relkind <> 'i' AND nspname !~ '^pg_toast' Please help, Thanks! Shiva