Rafael Martinez <r.m.guerrero@usit.uio.no> writes:
> I wonder why the function pg_relation_size(text) does not take into
> account the space used by toast data in a table when returning the space
> used by the table.
It's not supposed to. Use pg_total_relation_size if you want a number
that includes index and toast space.
regards, tom lane