BUG #6149: My table is empty but pg_relation_size(name) returns 39 MB

From: "Shivakumar Ramannavar" <shivasr(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6149: My table is empty but pg_relation_size(name) returns 39 MB
Date: 2011-08-04 11:16:04
Message-ID: 201108041116.p74BG4nR048658@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 6149
Logged by: Shivakumar Ramannavar
Email address: shivasr(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Silvio Brandani 2011-08-04 13:47:22 Re: [JDBC] Postgres Server Jdbc driver error
Previous Message Oliver Jowett 2011-08-04 11:00:01 Re: [JDBC] Postgres Server Jdbc driver error