pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Calculation of db size
3+ messages / 3 participants
[nested] [flat]

* Calculation of db size
@ 2019-01-21 14:09  Horst Düster <horst.duester@sourcepole.ch>
  0 siblings, 2 replies; 3+ messages in thread

From: Horst Düster @ 2019-01-21 14:09 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Then I have a subsequent question.

Does the query

SELECT g_database_size('dbname');

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

Regards
Horst

-- 
Dr. Horst Düster
Managing Director
Sourcepole AG - Linux & Open Source Solutions 
Weberstrasse 5, 8004 Zürich, Switzerland
Tel: +41 (0)44 440 77 11
Direkt: +41 (0)44 515 67 70
horst.duester@sourcepole.ch  http://www.sourcepole.ch

qgiscloud.com - Karten einfach vom Desktop ins Netz







^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Calculation of db size
@ 2019-01-21 14:22  Andrew Gierth <andrew@tao11.riddles.org.uk>
  parent: Horst Düster <horst.duester@sourcepole.ch>
  1 sibling, 0 replies; 3+ messages in thread

From: Andrew Gierth @ 2019-01-21 14:22 UTC (permalink / raw)
  To: Horst Düster <horst.duester@sourcepole.ch>; +Cc: pgsql-admin@lists.postgresql.org

>>>>> "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)




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Calculation of db size
@ 2019-01-21 14:23  Shreeyansh Dba <shreeyansh2014@gmail.com>
  parent: Horst Düster <horst.duester@sourcepole.ch>
  1 sibling, 0 replies; 3+ messages in thread

From: Shreeyansh Dba @ 2019-01-21 14:23 UTC (permalink / raw)
  To: Horst Düster <horst.duester@sourcepole.ch>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Yes, pg_database_size() includes all disk space used by the database i.e.
catalog tables or user data.

Thanks & Regards,
*Shreeyansh DBA Team*
www.shreeyansh.com


On Mon, Jan 21, 2019 at 7:39 PM Horst Düster <horst.duester@sourcepole.ch>
wrote:

> Then I have a subsequent question.
>
> Does the query
>
> SELECT g_database_size('dbname');
>
> take into account the storage space of the table pg_shdepend or not?
>
> Regards
> Horst
>
> --
> Dr. Horst Düster
> Managing Director
> Sourcepole AG - Linux & Open Source Solutions
> Weberstrasse 5, 8004 Zürich, Switzerland
> Tel: +41 (0)44 440 77 11
> Direkt: +41 (0)44 515 67 70
> horst.duester@sourcepole.ch  http://www.sourcepole.ch
>
> qgiscloud.com - Karten einfach vom Desktop ins Netz
>
>
>
>
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-01-21 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21 14:09 Calculation of db size Horst Düster <horst.duester@sourcepole.ch>
2019-01-21 14:22 ` Andrew Gierth <andrew@tao11.riddles.org.uk>
2019-01-21 14:23 ` Shreeyansh Dba <shreeyansh2014@gmail.com>

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