Re: [patch] Add schema total size to psql \dn+

Поиск
Список
Период
Сортировка
От Gilles Darold
Тема Re: [patch] Add schema total size to psql \dn+
Дата
Msg-id 0fd222d4-605d-03f2-0a37-385988fb815f@dalibo.com
обсуждение исходный текст
Ответ на [patch] Add schema total size to psql \dn+  (Gilles Darold <gilles.darold@dalibo.com>)
Ответы Re: [patch] Add schema total size to psql \dn+  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
Le 20/02/2019 à 23:26, Gilles Darold a écrit :
> Hi all,
>
>
> When we want to get total size of all relation in a schema we have to
> execute one of our favorite DBA query. It  is quite simple but what
> about displaying schema size when using \dn+ in psql ?
>
>
> gilles=# \dn+
>                                List of schemas
>   Name  |  Owner   |  Access privileges   |  Size   |      Description 
> --------+----------+----------------------+---------+------------------------
>  public | postgres | postgres=UC/postgres+| 608 kB  | standard public schema
>         |          | =UC/postgres         |         |
>  test   | gilles   |                      | 57 MB   |
>  empty  | gilles   |                      | 0 bytes |
> (3 rows)
>
> The attached simple patch adds this feature. Is there any cons adding
> this information? The patch tries to be compatible to all PostgreSQL
> version. Let me know if I have missed something.


Improve this patch by using LATERAL JOIN when version >= 9.3.


-- 
Gilles Darold
Consultant PostgreSQL
http://dalibo.com - http://dalibo.org


Вложения

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

Предыдущее
От: Christoph Berg
Дата:
Сообщение: Re: Reporting script runtimes in pg_regress
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: WAL insert delay settings