pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Horst Düster <horst.duester@sourcepole.ch>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Calculation of db size
Date: Mon, 21 Jan 2019 14:22:27 +0000
Message-ID: <87fttm3xlm.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <3d17ce68-70b6-677c-311e-b05b5195ba35@sourcepole.ch>
References: <3d17ce68-70b6-677c-311e-b05b5195ba35@sourcepole.ch>

>>>>> "Horst" == Horst Düster <horst.duester@sourcepole.ch> writes:

 Horst> Then I have a subsequent question.

 Horst> Does the query

 Horst> SELECT g_database_size('dbname');

 Horst> take into account the storage space of the table pg_shdepend or
 Horst> not?

It does not. Nor does it include the other global tables, such as
pg_database, pg_authid, etc. To get the list of global tables and their
indexes, use:

select relname from pg_class where relisshared;  

The size of the global tables and indexes, which don't count towards the
size of any individual database, can be obtained with
pg_tablespace_size('pg_global'). (All global tables must be in the
pg_global tablespace, and no other tables are allowed there.)

-- 
Andrew (irc:RhodiumToad)




view thread (3+ messages)  latest in thread

Message-ID: <87fttm3xlm.fsf@news-spur.riddles.org.uk>
Permalink:  ../87fttm3xlm.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87fttm3xlm.fsf@news-spur.riddles.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, horst.duester@sourcepole.ch, pgsql-admin@lists.postgresql.org
  Subject: Re: Calculation of db size
  In-Reply-To: <87fttm3xlm.fsf@news-spur.riddles.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox