Re: [PATCH] psql: add size-based sorting options (O/o) for tables and indexes

Aleksander Alekseev <aleksander@tigerdata.com>

From: Aleksander Alekseev <aleksander@tigerdata.com>
To: pgsql-hackers@postgresql.org
Cc: M.Atıf Ceylan <mehmet@atifceylan.com>
Date: 2025-11-26T13:40:32Z
Lists: pgsql-hackers
Hi,

> This patch adds two new meta-command modifiers for \dt(+) and \di(+):
>
>   -O  : sort by total relation size descending
>   -o  : sort by total relation size ascending
>
> This makes it easier to identify the largest tables and indexes
> without writing custom SQL queries.
>
> Help message (\?) is updated to reflect the new options.

Thanks for the patch. I have no strong opinion on whether this is a
valuable change but if you are adding new code it needs tests. The
corresponding documentation section should be changed as well [1].

Please re-submit the updated version of the patch as an attachment
created with `git format-patch` and add it to the nearest open
commitfest [2].

[1]: https://www.postgresql.org/docs/current/app-psql.html
[2]: https://commitfest.postgresql.org/

-- 
Best regards,
Aleksander Alekseev