Search Postgresql Archives

Re: dbsize command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux