Re: pg_database_size differs from df -s

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_database_size differs from df -s
Дата
Msg-id 11221.1338997787@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_database_size differs from df -s  (Frank Lanitz <frank@frank.uvena.de>)
Ответы Re: pg_database_size differs from df -s
Список pgsql-general
Frank Lanitz <frank@frank.uvena.de> writes:
> I've got an issue I'm not sure I might have a misunderstanding. When
> calling

> select sum(pg_database_size(datid)) as total_size from pg_stat_database

> the result is much bigger than running a df -s over the postgres folder
> - Its about factor 5 to 10 depending on database.

Did you mean "du -s"?

> My understanding was, pg_database_size is the database size on disc. Am
> I misunderstanding the docu here?

For me, pg_database_size gives numbers that match up fairly well with
what "du" says.  I would not expect an exact match, since du probably
knows about filesystem overhead (such as metadata) whereas
pg_database_size does not.  Something's fishy if it's off by any large
factor, though.  Perhaps you have some tables in a nondefault
tablespace, where du isn't seeing them?

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: problem after upgrade db missing
Следующее
От: Frank Lanitz
Дата:
Сообщение: Re: pg_database_size differs from df -s