I know its way too late in the game, sorry, but it's a very small patch...

I was wondering if this could be added to 8.3: it adds the dbsize to \l in psql.

It looks like this:

             List of databases
   Name    |  Owner   | Encoding | Dbsize
-----------+----------+----------+---------
 andy      | andy     | LATIN1   | 4255 kB
 cramd     | andy     | LATIN1   | 526 MB
 postgres  | postgres | LATIN1   | 4263 kB
 template0 | postgres | LATIN1   | 4136 kB
 template1 | postgres | LATIN1   | 4255 kB
(5 rows)


pretty nice, huh?

-Andy
--- src/bin/psql/describe.orig  2007-10-31 13:37:04.130331740 -0500
+++ src/bin/psql/describe.c     2007-10-31 13:37:07.130371448 -0500
@@ -400,6 +400,9 @@
        appendPQExpBuffer(&buf,
                        ",\n       pg_catalog.pg_encoding_to_char(d.encoding) 
as \"%s\"",
                                          _("Encoding"));
+       appendPQExpBuffer(&buf,
+                       ",\n       pg_size_pretty(pg_database_size(d.oid))  as 
\"%s\"",
+                                         _("Dbsize"));
        if (verbose)
        {
                appendPQExpBuffer(&buf,
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to