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-23 16:47:36
Message-ID: 47E689A8.4090802@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

> 2) how do I find out where the actual files for the database are stored on
> my system?
> Where is the default storage location?
>

The complete story is laid out in the docs here:
http://www.postgresql.org/docs/8.3/interactive/storage-file-layout.html

HTH,
Paul

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2008-03-23 16:54:45 Re: How to concatenate a boolean to a text string for an EXECUTE stmt in a stored proc
Previous Message Pavel Stehule 2008-03-23 16:30:21 Re: scheduling stored procedure