Re: dbsize command

From: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: dbsize command
Date: 2008-06-23 20:24:33
Message-ID: 200806232224.34133.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 23. June 2008, salman wrote:

>This is what I use: SELECT
>pg_size_pretty(pg_database_size(current_database()));

Great, I remember that I saw it, but couldn't remember the command. Now
I've made a function:

CREATE OR REPLACE FUNCTION db_size() RETURNS TEXT AS $$
SELECT pg_size_pretty(pg_database_size(current_database()));
$$ LANGUAGE sql STABLE;

pgslekt=> select db_size();
db_size
---------
63 MB
(1 row)

--
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE
My Jazz Jukebox: http://www.last.fm/user/leifbk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Antonio Perez 2008-06-23 20:29:03 Re: Update Join Query
Previous Message Antonio Perez 2008-06-23 20:11:51 Re: Update Join Query