Database size on disk

From: "Quiroga, Damian" <damian(dot)quiroga(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Database size on disk
Date: 2015-10-05 19:47:03
Message-ID: 5F6634B7560CA34EA814093D8CDACAC736FAAFBD@fmsmsx107.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I'm looking for some advice on how to determine the DB size on disk to trigger some cleanup tasks (deleting old data) if some threshold is reached.

Let's say that for simplicity I don't want to ask for the size on disk to the OS, but rather to PostgreSQL itself. And I only have a single database other than the defaults ('template', etc).

In that scenario is using pg_database_size() reasonable? Does that function return the actual size on disk or is it a calculation? Is there a better alternative?

Thanks,

Damian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message dinesh kumar 2015-10-05 21:02:11 Re: Database size on disk
Previous Message Ramalingam, Sankarakumar 2015-10-05 19:35:04 Re: postgres standby won't start