AI Rumman <rummandba(at)gmail(dot)com> writes:
> I executed the following query and got an error:
> select relname, pg_size_pretty(pg_table_size(relname::text)) as s from
> pg_stat_user_tables order by pg_table_size(relname::text) desc limit 10;
> ERROR: relation "tab_20130206" does not exist
Use the OID, not the relname, else you'll have issues with any table
that's not in your search_path.
regards, tom lane