proposal - patch: psql - sort_by_size

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема proposal - patch: psql - sort_by_size
Дата
Msg-id CAFj8pRBQnKOtRFLgARNN_vsVjQ5QBLjZW6G_xPm-1=mBQx+jCA@mail.gmail.com
обсуждение исходный текст
Ответы Re: proposal - patch: psql - sort_by_size  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: proposal - patch: psql - sort_by_size  (Jeremy Finzel <finzelj@gmail.com>)
Список pgsql-hackers
Hi

I returned to possibility to sort output of \d* and \l by size. There was more a experiments in this area, but without success. Last patch was example of over engineering, and now, I try to implement this feature simply how it is possible. I don't think so we need too complex solution - if somebody needs specific report, then it is not hard to run psql with "-E" option, get and modify used query (and use a power of SQL). But displaying databases objects sorted by size is very common case.

This proposal is based on new psql variable "SORT_BY_SIZE". This variable will be off by default. The value of this variable is used only in verbose mode (when the size is displayed - I don't see any benefit sort of size without showing size). Usage is very simple and implementation too:

\dt -- sorted by schema, name
\dt+ -- still sorted  by schema, name

\set SORT_BY_SIZE on
\dt -- sorted by schema, name (size is not calculated and is not visible)
\dt+ -- sorted by size

\dt+ public.* -- sorted by size from schema public

Comments, notes?

Regards

Pavel

Вложения

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

Предыдущее
От: Luis Carril
Дата:
Сообщение: Option to dump foreign data in pg_dump
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Option to dump foreign data in pg_dump