psql show dbsize?

Поиск
Список
Период
Сортировка
От andy
Тема psql show dbsize?
Дата
Msg-id 4728CE43.4040708@squeakycode.net
обсуждение исходный текст
Ответы Re: psql show dbsize?  (Magnus Hagander <magnus@hagander.net>)
Re: psql show dbsize?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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,

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Postgresql 8.3 beta crash
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] AutoVacuum Behaviour Question