Re: dbsize command - Mailing list pgsql-general

From Leif B. Kristensen
Subject Re: dbsize command
Date
Msg-id 200806232224.34133.leif@solumslekt.org
Whole thread Raw
In response to Re: dbsize command  (salman <salmanb@quietcaresystems.com>)
List 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/

pgsql-general by date:

Previous
From: Antonio Perez
Date:
Subject: Re: Update Join Query
Next
From: Antonio Perez
Date:
Subject: Re: Update Join Query