Re: Table size does not include toast size

Bernd Helmle <mailings@oopsware.de>

From: Bernd Helmle <mailings@oopsware.de>
To: Tom Lane <tgl@sss.pgh.pa.us>, Rafael Martinez <r.m.guerrero@usit.uio.no>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2009-12-21T15:25:07Z
Lists: pgsql-hackers

--On 21. Dezember 2009 10:01:37 -0500 Tom Lane <tgl@sss.pgh.pa.us> wrote:

> It's not supposed to.  Use pg_total_relation_size if you want a number
> that includes index and toast space.

I've created a C-Function a while ago that extracts the TOAST size for a 
given relation. This gave me the opportunity to do a pg_relation_size(oid) 
+ pg_relation_toast_size(oid) for a given table oid to calculate on disk 
data size required by a table. Maybe we should include such a function in 
core?

-- 
Thanks

	Bernd