Re: table size and storage location

From: paul rivers <rivers(dot)paul(at)gmail(dot)com>
To: chuckee <mi6(at)orcon(dot)net(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: table size and storage location
Date: 2008-03-26 01:53:28
Message-ID: 47E9AC98.9010401@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

chuckee wrote:
> paul rivers-2 wrote:
>
>> chuckee wrote:
>>
>>> 1) how do I find out the size, in MB, of a particular table (called
>>> 'capture' in this case).
>>> I tried entering the SQL query SELECT (pg_tablespace_size('capture'));
>>> The result was the following:
>>> ERROR: tablespace "capture" does not exist
>>>
>>>
>> You're looking for pg_relation_size('capture') or
>> pg_total_relation_size('capture'). A tablespace is a named location for
>> creating objects.
>>
>>
>>
>
> Thanks but I still get the error 'ERROR: relation "capture" does not exist'
> when trying these two alternative functions you mention above. There is
> definitely a table called 'capture' in my database!
>

Is the schema for capture in your search_path? If not, include that in
the function call: function('yourschema.capture'). Otherwise, what
version are you on? I don't know when these functions were added;
perhaps you're stuck doing the math yourself on page counts in pg_class.

Paul

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-03-26 02:09:58 Re: table size and storage location
Previous Message Andrej Ricnik-Bay 2008-03-26 01:51:04 Re: table size and storage location